We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I got the code USB secondary ISP bootloader for LPC23xx from NXP working fine with none RTX kernel but It does not working with RTX kernel. If anyone know more detail please help.
Thank you.
Hi Tamir,
Thanks for your responses.
I will do some simple tests to make sure some basic points.
Looks like you use the RTX kernel on BOTH your Bootloader and Application?
My bootloader is as simple as it can be; it either jumps (via a SWI) to the application or updates the application software. No RTX there, just an infinite loop.
I use the LPC23xx USB Bootloader from NXP directly, I do not modify anything of it. I download the Memory.bin (Bootloader) into my LPC2378. And I have an application with RTX kernel, I follow the solutions mentioned in the above of this thread.
1. Set IROM1 Start: 0x2000 Size: 0x7E000 2. Set IRAM1 Start: 0x40000200 Size: 0x7E00 3. On the Startup file of my application: Set Options-> Asm-> Conditional Assembly Control Symbols: RAM_INTVEC REMAP RAM_MODE 4. Add the below code into the Startup file of my application.
; Setup Stack for each mode ---------------------------------------------------- ; Stack setup code will not run when MCU in User mode ; as occur when this code run after secondary boot loader ; The following code will do fake calling to Software interrupt to enter Supervisor mode ; so stacks init code will work properly. ; Start of edit SWI_RAM_ADDR EQU 0x40000028 LDR R8, =SWI_RAM_ADDR ; LDR R7, [R8] ;Save SWI_Handler address LDR R9, =Stack_Set_Addr STR R9, [R8] ;Replace SWI_Handler (for next command) with Stack_Set_Addr SWI 11 ;Just jump to Stack_Set_Addr in Supervisor mode Stack_Set_Addr DCD Stack_Setup Stack_Setup STR R7, [R8] ;Restore SWI_Handler address ; End of edit LDR R0, =Stack_Top
After all of that, I start my Debug Session. The Disassembly Window shows the Machine Code/ASM Code of the Bootloader (without the Source Code). Then, the Bootloader jumps to my application. So that, I get the state while the Bootloader just finishes its work, and pass the control to my application. I can observe the CPSR and the R13/SP of Supervisor Mode etc, to see if the solutions works properly.
My problem is: sometimes the "memory re-mapping" works fine, sometimes the "memory re-mapping" just doesn't work; it seems it is related to the breakpoints I set; but I am not so sure.
Does anyone else encounter the same problem? And How do people debug your Bootloader/Application?
I have never encounter a situation where these macros don't work. why are you augmenting the startup file? that is not required at all. just make the function that jumps to the application a SWI function, not forgetting to create a SWI table in a separate .s file as well documented.
http://www.keil.com/support/docs/2963.htm
ARM: ATMEL REMAP CAUSES PROBLEMS WITH ULINK DEBUGGING
The REMAP feature on Atmel devices exchanges RAM and Flash areas. When the remapping is done before ULINK can stop the device, you will see swapped memory areas in the debugger and the CPU may not behave correctly.
-> just make the function that jumps to the application a SWI function,
I tried to do that once or twice, but failed. When I get a better understanding of all of these, maybe I will try it again.