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.

BusFault on a code protected device when using rtsv7M4_T_le_v4SPD16_eabi.lib functions

Other Parts Discussed in Thread: CODECOMPOSER

Hello, I'm new here. I searched a while in the forum with no luck about this issue.

I'm using an TM4C1233H6PMI device, with a very simple code. Based on SPMA044A application report (spma044a.pdf) I protected a section of the code (from 0x800 to 0x1800 where the .text section is placed) as execute-only. Working with CodeComposer v5.5.0.00077.
I can run all the code, but when the code makes a call to a strtok() it generates a busfault. This behaviour is seen only with strtok(); i've tried with strcmp(), strcpy() and some driverlib functions and they all function properly, i mean, they don't trigger a BusFault.

Looking into the disassembly code, there is an LDR call pointing to a protected memory area (I put a breakpoint before the FlashProtectSet() call in order to see the disassembly, that's why is visible in the image).

Going deeper, the FaulStat shows a BusFault precise fault, and the FaultAddress is shown in the image.

The disassembly at the Fault Address shows this:

As you can see, the LDR instruction points to $C$CON1. 

Now the question is: how Can I fix this issue? I'm missing something here?

Here is the map section in which strtok() is placed, and the memory configuration (only useful data shown)

MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  FLASH                 00000000   00000800  0000026c  00000594  R  X
  FLASH_EX              00000800   00001800  00000fa8  00000858     X
  FLASH_2               00002000   0003e000  000007ba  0003d846  R  X
  SRAM                  20000000   00008000  0000044e  00007bb2  RW X

SEGMENT ALLOCATION MAP

run origin  load origin   length   init length attrs members
----------  ----------- ---------- ----------- ----- -------
00000000    00000000    0000026c   0000026c    r--
  00000000    00000000    0000026c   0000026c    r-- .intvecs
00000800    00000800    00000fa8   00000fa8    r-x
  00000800    00000800    00000fa8   00000fa8    r-x .text
00002000    00002000    000007c0   000007c0    r--
  00002000    00002000    00000782   00000782    r-- .const
  00002788    00002788    00000038   00000038    r-- .cinit
20000000    20000000    00000451   00000000    rw-
  20000000    20000000    00000400   00000000    rw- .stack
  20000400    20000400    00000035   00000000    rw- .bss
  20000438    20000438    00000019   00000000    rw- .data


SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
00001540    00000048     rtsv7M4_T_le_v4SPD16_eabi.lib : boot.obj (.text)
00001588    00000044                                   : cpy_tbl.obj (.text)
000015cc    00000044                                   : exit.obj (.text)
00001610    00000040                                   : strtok.obj (.text)

Thanks in advance