eZ430 Chronos 的无线 BSL(Bootstrap Loader)功能原理详解

eZ430 Chronos 的无线 BSL(Bootstrap Loader) 功能原理详解

app

eZ430 Chronos 提供了一个名为 RFBSL 的功能,也就是经过RF无线方式来执行BSL操做进行手表固件程序(firmware
)的刷新,不须要拆开手表链接到JTAG接口,很是方便调试手表上运行的程序。我开始时没有理解BSL方式,一直也没搞清楚具体的细节实现是如何进行的,昨天把SLAU292C(eZ430-Chronos™ Development Tool User's Guide)的相关章节认真读了一遍以后终于明白了 eZ430 Chronos 的BSL详细流程。less

RFBSL 的详细流程以下:
一、首先要在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 的文件,不然就是一个悲剧(我第一次刷就遇到这个悲剧,当时还奇怪怎么这个固件文件这么小呢?),以下图示:
rfbsl

二、手表侧执行 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的主程序函数以下:ide

#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();
}

三、在手表上执行 rFBSL 程序以后,手表侧会尝试和 PC 侧创建无线链接,链接成功后,会从 PC 侧下载那个名为 ram_based_updater.txt 的文件(这个文件只要放在和 Control Center 程序同一个目录下便可,系统本身已经准备好了,不须要手动指定)到手表的 RAM 中,成功下载后,就执行 RAM 中新下载的这个程序,这个程序会再次尝试链接 PC 侧来获取真正的更新镜像文件,若是链接成功,flash 就会执行块删除,从 0x8000 到 0xFFFF 的32KB的 flash 区域所有被删除。而后它会开始接收数据包而且写入到 flash 中,写入时会检查每一个 word 是否写入成功,写 falsh 时手表的LCD屏幕右上角会显示一个百分比进度,从 0% 开始到 100% 结束。函数

四、成功写入固件文件后,手表会重启,全部的日期时间都会被重置为初始值。
 
原文描述以下:
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.ui

【PC侧的流程:】
rfbsl-pcthis

【手表侧的流程:】
rfbsl-ez430spa

相关文章
相关标签/搜索