This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
问题背景:由于电路板装在复杂结构内部,必须实现串口更新flash程序,我在实现的时候,遇到了一系列问题。采用tivaware安装目录下的demo,建立自己的工程,编译bootloader,烧写到芯片中,bootloader接收数据进行应用程序更新。但是bootloader烧写到flash中,连接串口,给单片机发送测试命令,没有任何反应。在线调试bootloader,程序直接跑飞了,芯片直接被锁定了,并且不能连接仿真器了,必须用uniflash擦除flash。我也不知道哪里有错误。
详细问题如下:
没有楼主改的这么详细。关于自己写boot的问题,可以参考这个帖子
http://www.deyisupport.com/question_answer/microcontrollers/tiva_arm_cortex/f/96/t/61154.aspx
其实用ROM_UpdateUART()这个函数更方便点。
谢谢您的回答,这个帖子我之前看过,该帖子是通过LM programer 下载应用程序和bootloader程序,从应用程序跳转到bootloader 进行程序更新,是标准串口。
而我采用的串口是cameralink接口映射的串口,我用cameralink线将pc机和电路板连接之后,芯片和LM programer 之间是未连接的。还有我用的芯片和demo的芯片是不一样的。
请问用ROM_UpdateUART()怎么实现??
#define TARGET_IS_BLIZZARD_RB1 #include <stdint.h> #include <stdbool.h> #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "inc/hw_nvic.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/rom.h" #include "driverlib/uart.h" void JumpToBootLoader(void) { // // We must make sure we turn off SysTick and its interrupt before entering // the boot loader! // ROM_SysTickIntDisable(); ROM_SysTickDisable(); // // Disable all processor interrupts. Instead of disabling them // one at a time, a direct write to NVIC is done to disable all // peripheral interrupts. // HWREG(NVIC_DIS0) = 0xffffffff; HWREG(NVIC_DIS1) = 0xffffffff; ROM_UpdateUART(); } void SetupForUART(void) { ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // Configure the UART for 115200, n, 8, 1 ROM_UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200, (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE | UART_CONFIG_WLEN_8)); // // Enable the UART operation. // ROM_UARTEnable(UART0_BASE); } int main(void) { int i; ROM_SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x02); for(i=0;i<50;i++) ROM_SysCtlDelay(100000); SetupForUART(); ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x04); JumpToBootLoader(); while(1) { } }
那个帖子上面就有的,可以参考看看。
谢谢您的回复! 您的意思是强制跳转到ROM 中的自带bootloader 进行程序更新么?ROM_UpdateUART()函数看不到源码,串口接收的数据协议我不知道?
苦行僧您好: