Memcpy trap

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User18294
Level 1
Level 1
Hello,

I have a question regarding using "memcpy" function to manually copy some function from flash into PSPR. In my case it looks like:

// Copy fixed chunk of 100 bytes starting at "my_flash_func" to "pspr_addr"
mempcy( pspr_addr, my_flash_func, 100);

I know that this is not good practice but I've encountered this scenario and there is need to solve it. After playing around and inspections of map file I've found out that a memcpy function cause trap but only when
a flash function lies in two different logic sectors
of PFLASH0. Trap info: BusError TIN=2 (Data Access Synchronous Error).

So, my question here is, why does memcpy function trap if during function copy logic sector of memory is change?

I'm using TC26x processor and TriCore Eclipse IDE v6.2r2 .

BR, Žiga
0 Likes
3 Replies
Darren_Galpin
Employee
Employee
First solution authored First like received
You can set different protections for different sectors - you should check that the protection is the same for the two areas. Is this happening for any crossing between sectors, or only between specific ones?
0 Likes
User18294
Level 1
Level 1
Memory protection was not change so it should be set to default values. Trap happens crossing logic sector S7 and S8. See attachement for details. 4882.attach
0 Likes
Darren_Galpin
Employee
Employee
First solution authored First like received
The line following this table in the spec says that S7 contains the BMI (Boot Mode Index) header, so could there be different default protection for the two sectors?
0 Likes