Hello,
This is my first time posting to a forum. I'm currently working on the Battery Management System of an electric motor vehicle and we need to program the code in the flash so we can reset it when we need to and run the code without having to plug it into a computer.
When I program the the code in release with the debug probe of the FTDI of the board (which we designed), everything works fine. As soon as I take the debug probe off and the code is still running, no interrupts are seen by the micro controller, while the program still runs. Even if I cycle the power and hit the reset button on the board, the interrupts are still not seen by the micro controller. I have tried loading the interrupt function in the flash, and copying it to the ram on the main start-up, but still nothing.
Here is the section portion of the sys_link.cmd file
SECTIONS { .intvecs : {} > VECTORS .text : {} > FLASH0 | FLASH1 //code .const : {} > FLASH0 | FLASH1 //constant data .cinit : {} > FLASH0 | FLASH1 //initialization tables .pinit : {} > FLASH0 | FLASH1 // .bss : {} > RAM //global and static vars ramfuncs : LOAD = FLASH0, RUN = RAM, LOAD_START(__RamfuncsLoadStart), LOAD_END(__RamfuncsLoadEnd), RUN_START(__RamfuncsRunStart) .data : {} > RAM // .sysmem : {} > RAM // DYNAMIC MEMORY ALLOCATION AREA .stack : /* SOFTWARE SYSTEM STACK */ { /* initial stack pointer values */ . += 0x00000400; _Stack_Table_Pointer = .; . += 0x00000400; _Stack_Handler_Pointer = .; } > STACKS }
Here is the start of my main function
extern unsigned long __RamfuncsLoadStart; extern unsigned long __RamfuncsLoadEnd; extern unsigned long __RamfuncsRunStart; #pragma CODE_SECTION(canTransmit,"ramfuncs") #pragma CODE_SECTION(spiTransmitDataBQ,"ramfuncs") #pragma CODE_SECTION(spiReceiveDataBq,"ramfuncs") #pragma CODE_SECTION(spiReceiveDataCURRENT,"ramfuncs") #pragma CODE_SECTION(gioHighLevelInterrupt,"ramfuncs") #pragma CODE_SECTION(gioLowLevelInterrupt,"ramfuncs") #pragma CODE_SECTION(gioNotification,"ramfuncs") void main(void) { // fonctions d'init vont ici! mets les tous long qw; for(qw=0;qw<10000000;qw++); CopyRamFuncs(); //...A lot of more code goes here... }
There is a lot of info on how to program to the flash memory for standalone programs on the TMS320, but not a whole lot on the TMS470M, so my question is the following. How do I send the code properly to the flash, including the interrupts?
Thank-you in advance.