Other Parts Discussed in Thread: HALCOGEN, UNIFLASH
Hello,
I am trying to setup my own bootloader via TFTP. So far, I've created a test application (BlinkApp.bin), can communicate via TFTP, and can store binary in flash. The bootloader seems to run correctly and do it's job.
However, I have not been able to get my application code to run correctly. I am trying to run the application from bank1, sector 0, 0x00180000. The application runs perfectly without the bootloader (at it's default memory location in flash - generated by HalCoGen).
Using the memory browser, I can see that my code is in memory at the location I want it:
As soon as I start debugging the bootloader application, the disassembly of this memory location (app) looks incorrect (to me):
I don't know if this is actually causing the problem, or just a result from the application being in binary format, but every time I go to run the application at that memory location using:
address_test = (uint32)APP_START_ADDR; ((void (*)(void))address_test)();
the bootloader throws me into a prefetchEntry after this call.
sys_intvecs.asm for bootloader:
.sect ".intvecs" .arm ;------------------------------------------------------------------------------- ; import reference for interrupt routines .ref _c_int00 .ref _dabort .ref phantomInterrupt .def resetEntry ;------------------------------------------------------------------------------- ; interrupt vectors resetEntry b _c_int00 undefEntry b #0x0017FFF8 svcEntry b svcEntry prefetchEntry b prefetchEntry b _dabort b phantomInterrupt ldr pc,[pc,#-0x1b0] ldr pc,[pc,#-0x1b0] ;-------------------------------------------------------------------------------
sys_link.cmd for application:
/* Linker Settings */ --retain="*(.intvecs)" /* USER CODE BEGIN (1) */ //FLASH1 (RX) : origin=0x00220000 length=0x000E0000 //VECTORS (X) : origin=0x00180000 length=0x00180020 /* Assign FLASH_APP to occupy sectors 0-4 of bank 1*/ //FLASH_APP (RX) : origin=0x00180020 length=0x000A0000 - 0x20 fill=0xFFFFFFFF /* USER CODE END */ /*----------------------------------------------------------------------------*/ /* Memory Map */ MEMORY { VECTORS (X) : origin=0x00180000 length=0x00000020 FLASH_APP (RX) : origin=0x00180020 length=0x9000 - 0x20 fill=0xFFFFFFFF FLASH1 (RX) : origin=0x00189000 length=0x00180000 - 0x9000 STACKS (RW) : origin=0x08000000 length=0x00001500 RAM (RW) : origin=0x08001500 length=0x0003EB00 /* USER CODE BEGIN (2) */ /* USER CODE END */ } /* USER CODE BEGIN (3) */ /* USER CODE END */ /*----------------------------------------------------------------------------*/ /* Section Configuration */ SECTIONS { .intvecs : {} > VECTORS .text : {} > FLASH_APP .const : {} > FLASH_APP .cinit : {} > FLASH_APP .pinit : {} > FLASH_APP .bss : {} > RAM .data : {} > RAM .sysmem : {} > RAM
The sys_link.cmd for bootloader and the sys_intvecs.asm for the application are left at their default configs.
I'd really like to know:
1. Why this application won't run after calling that memory address
2. Why the disassembly looks like it's structured incorrectly
3. If there is anything else I am missing to correctly run a simple application from memory address 0x00180000 using my bootloader
I've looked through all the bootloader examples TI offers for RM48s, and I've looked around for questions like mine, with no such answers to my questions. Closest question to my questions was this one which did not solve my problems unfortunately.
Thanks,
-Nate J