Other Parts Discussed in Thread: HALCOGEN
7875.Test.zipHello Community,
I'm encountering a problem when merging my application with FreeRTOS. The application by itself runs well bare metal.
I created a new CCS project (v7.4) and a new HALCoGen file for the merged version. Now whenever I try to initialize a variable in the stack that is more than 1 byte in size (int for example), the program crashes and ends in the "dataEntry" line of HL_sys_intvecs.asm. I checked the MPU settings and according to them RAM should start at 0x08000000 and end at 0x0807FFFF. For some reason the initial SP is getting set to addresses like 0x07FFFAA00. Therefore, it is out of bounds of the RAM. If I manually change the SP address to something close to 0x08000000 then the initialization works (but of course this is not a solution). Going through the disassembly, I noticed that bools, unit8_ts, and other one byte long data types get allocated and initialized inside the RAM boundaries by passing in big offsets to the strb instruction:
strb r12, [sp, #0x8a4]
This is the for the first boolean that gets initialized.
However, the following is the instruction that gets executed when initializing an int:
str r12, [sp] (no offset and SP is set to an address outside of RAM)
The program then crashes since it tried to write to a prohibited location.
Sounds to me like something is off configuration wise...but I've compared the CCS and HALCoGen settings between my two projects and so far have not found anything that would have to do with this. Also, I ran the same application with FreeRTOS using a TMS57 board and it worked fine with it. For both, I used the TI v16.9.6.LTS compiler.
I attached my HALCoGen file in case someone can take a look at it.
I appreciate any help and guidance you can provide.
Thank you,
Surialic