打印

Z430 Chronos 的无线 BSL(Bootstrap Loader)功能原理详解--转发

[复制链接]
1353|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
i1mcu|  楼主 | 2013-10-30 15:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
eZ430 Chronos 提供了一个名为 RFBSL 的功能,也就是通过RF无线方式来执行BSL操作进行手表固件程序(firmware)的刷新,不需要拆开手表连接到JTAG接口,非常方便调试手表上运行的程序。我开始时没有理解BSL方式,一直也没搞清楚具体的细节实现是如何进行的,昨天把SLAU292C(eZ430-Chronos™ Development Tool User's Guide)的相关章节认真读了一遍之后终于明白了 eZ430 Chronos 的BSL详细流程。

RFBSL 的详细流程如下:
1、首先要在PC侧运行 Control Center ,选择 Wireless Update ,注意,这里一定要选择正确的 firmware 文件,eZ430 Chronos 的 firmware 文件就是用CCS编译生成的位于 D:\EZ430\workspace\ez430_chronos\915MHz - Unrestricted CCS Platinum 目录下的那个名为 ez430_chronos_915MHz.txt 的文件,千万不要选择那个位于 D:\Program Files\Texas Instruments\eZ430-Chronos\Control Center\Chronos Control Center 目录下的名为 ram_based_updater.txt 的文件,否则就是一个悲剧(我第一次刷就遇到这个悲剧,当时还奇怪怎么这个固件文件这么小呢?),如下图示:

相关帖子

沙发
i1mcu|  楼主 | 2013-10-30 15:47 | 只看该作者
2、手表侧执行 rfBSL 程序,该程序的主要作用就是先检查电池电压,再检查BlueRobin程序状态,再检查SimpliciTI程序状态,如果电池电压没有过低,BlueRobin和SimpliciTI都没有执行,则跳转到 flash 的 0x1000 地址处,这时手表上所有其他的用户程序全部被停止,从 0x1000 开始的2KB的flash区域内保存着BSL程序,这个程序是事先写好放在这里的(如果想自己开发BSL程序,也可以,使用 BM innovations 的 Firmware Update Tool 就行了.详细参见 3.6.3.4.2 eZ430-Chronos Watch Update),rfbsl.c的主程序函数如下:

#define CALL_RFSBL()   ((void (*)())0x1000)()

void sx_rfbsl(u8 line)
{
  // Exit if battery voltage is too low for radio operation
  if (sys.flag.low_battery) return;
  
  // Exit if BlueRobin stack is active
  if (is_bluerobin()) return;
  
  // Exit if SimpliciTI stack is active
  if (is_rf()) return;
  
  // Before entering RFBSL clear the LINE1 Symbols
  display_symbol(LCD_SYMB_AM, SEG_OFF);

clear_line(LINE1);
  
  // Write RAM to indicate we will be downloading the RAM Updater first
  display_chars(LCD_SEG_L1_3_0, (u8 *)" RAM", SEG_ON);
  
  // Call RFBSL
  CALL_RFSBL();
}

使用特权

评论回复
板凳
i1mcu|  楼主 | 2013-10-30 15:48 | 只看该作者
3、在手表上执行 rFBSL 程序之后,手表侧会尝试和 PC 侧建立无线连接,连接成功后,会从 PC 侧下载那个名为 ram_based_updater.txt 的文件(这个文件只要放在和 Control Center 程序同一个目录下即可,系统自己已经准备好了,不需要手动指定)到手表的 RAM 中,成功下载后,就执行 RAM 中新下载的这个程序,这个程序会再次尝试连接 PC 侧来获取真正的更新镜像文件,如果连接成功,flash 就会执行块删除,从 0x8000 到 0xFFFF 的32KB的 flash 区域全部被删除。然后它会开始接收数据包并且写入到 flash 中,写入时会检查每个 word 是否写入成功,写 falsh 时手表的LCD屏幕右上角会显示一个百分比进度,从 0% 开始到 100% 结束。

4、成功写入固件文件后,手表会重启,所有的日期时间都会被重置为初始值。
手册原文描述如下:
3.6.3.2 Detailed Description of the Wireless Update Feature
To invoke the wireless update procedure, the main application must call the start of the wireless updater,
which is located at address 0x1000. Therefore, the sports watch and data logger projects contain an extra
menu item called "rFbSL". Once activated, it checks if the battery level of the watch is sufficient to start a
wireless update and then calls address 0x1000. At this point the user application is no longer running.
NOTE: Whenever the wireless update is activated on the watch, it returns to the main application
with a reset, regardless if an update was performed or not. Time, data, alarm and other
RAM-based data is lost.
After invoking the wireless update (rFbSL), the watch tries to link to a listening RF access point and start
the update procedure. If the link is successful, the watch downloads the RAM based updater into the RAM
of the CC430. Once finished, this software then tries to link again with the RF access point to download
the actual update image. If this link is successful, a mass flash erase is performed, which erases all the
main memory flash (0x8000 to 0xFFFF). It then start receiving all the data packets and writes them to
flash, checking if each word was written successfully. If the link is not successful, the watch generates a
reset to restart the user application. During the download of the update image, a percentage indicator
appears on the watch. "dOnE" appears and a reset is generated to start the new user application that has
just been written to flash.

使用特权

评论回复
地板
i1mcu|  楼主 | 2013-10-30 15:48 | 只看该作者
【PC侧的流程:】

使用特权

评论回复
5
i1mcu|  楼主 | 2013-10-30 15:48 | 只看该作者
【手表侧的流程:】

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

272

主题

8422

帖子

9

粉丝