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.

CCS/TMS320F28379D: CAN bootloader jumps to ILLEGAL ISR ()

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

Hi Team,
I am working on CAN bootloader for TMS320F28379D. I send all hex data via PEAK CAN analyzer from PC to DSP. Currently there is no control of fails on CAN bus, so all hex frames are sent with just delay between frames. I am planning to add checksums of all data blocks and addresses in future. Flash API didn't detect problems when data is programming to FLASH.

Bootloader is placed in FLASHA and FLASHB and main application is placed in flash blocks begins from FLASHC.

I have done a few different tests:
1. Check if the data frames are placed correctly in FLASH sectors with correct hex data and end its work after got length of block equal 0x0000 as it is depicted in TRM.
2. Program main program via JTAG to FLASHC with erasing all flash sectors and then program bootloader to FLASHA and FLASHB. After that, I am sure that both programs are placed correctly in FLASH memory. Using a pointer to _c_int00 I jump to begin of the main app and it works very well.
static void(*APPEntry)(void);
APPEntry = (void(*)(void))(entryAdress);
ESTOP0;
(*APPEntry)();

3. I used an application to send data via CAN and place it on appropriate sectors in FLASH via bootloader which is placed in FLASHA and B. So then I tried to jump to the main application and bootloader jumps to ILLEGAL ISR().
I am pretty sure that the data is received and placed correctly but main application didn't start and after jump bootloader program stays in bootloader ILLEGAL ISR() (at address 0x08042E).

My FLASH API configuration is the same as in serial_flash_programming example. I program flash with ECC enabled. My interrupts are enabled because I would like to use interrupts to initialize boot process. Interrupts works correctly if I program both programs via JTAG and jumps between applications from CSS so I assume if I program flash via CAN bus, the interrupts should also work.

I added vie appendixes with source code and .cmd files for both applications.

In both programs epwm interrupts are working and different programs sends different data via CAN so I can check which program is working in appropriate time.

Thank you for your help.

Mateusz Stasiak

CAN_bootloader.zip

  • Hello

    Have you been able to set breakpoint at intended entry address and confirm that the application is programmed correctly? You can do a CCS memory dump after updating via bootloader and then the same after using JTAG to compare.

    Best regards

    Chris

  • Hi Christopher,

    I am sure that the application is programmed correctly. All data is the same in flash either I program via JTAG or via CAN bootloader. 

    1. When the main application is placed in FLASHC via JTAG and I overwrite program via CAN bootloader I can do a jump to main application.

    2. When I erase FLASH and program main application to flash once again I can't jump to main application. This time bootloader jumps to NMI ISR(). Data is the same.

    Do I have to verify the new data on FLASH sectors?

    Thanks for your help.

    Mateusz 

  • Hello

    So when flash is fully erased and then you program with CAN bootloader, that's when you see issue? In this scenario, you've checked the flash contents to match that of the JTAG?

    Are you getting an ITRAP or NMI interrupt? Earlier you implied ITRAP and now you mention NMI. What NMI flag is getting set?

    As long as you're following the same flash process as in the serial flash kernel example, then you should be fine there.

    Best regards

    Chris

  • Hi Chris,

    I resolved that issue. I was using the wrong function to program FLASH. My simple function didn't have all the necessary capabilities. I was programming 16-bit data to FLASH, not 128-bit and didn't verify memory in sectors. The function in kernel_flash_programming example is correct and works.

    Without these features there were encountered error in ECC, single bit errors and uncorrectable errors at the start address of the programmed application. This probably was the cause of NMI ISR() or ILLEGAL ISR().

    Thanks for your help,

    Best,

    Mateusz