This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to convert R52 sample project from Arm Compiler for Embedded to GCC

Hi,

In order to introduce my issue, my goal is to get 2 similar projects, one compiled by Arm Compiler for Embedded 6 and the other by GCC,  both on a FVP Cortex R-52 target.

I chose to build the project on the example available when installing Arm Development Studio named startup_Cortex-R52.

Concerning the Arm Compiler part I have no issues, project works fine as I did not change anything. So I tried to build my second project, compiled by GCC based on the startup_Cortex-R52 example.

I added the GCC 10.3.1 toolchain to Arm Developement Studio and choosed this toolchain in the Tool Chain Editor of my project. I have also set up my project by giving these options in project properties for both GCC Compiler and Assembler : -mcpu=cortex-r52 -mfpu=neon-fp-armv8 -mfloat-abi=hard

Errors occur when I try to build the project and specially in the startup.s file are related to Assembler messages :

I am wondering why I faced this issues as the target is the same and Assembler language too.

If someone can help me to resolve this issue I would be grateful.

Regards, Enzo

Parents
  • Hi again Enzo

    A data abort will occur if an attempt is made to read/write a memory location, but there is no memory at that address, or the MPU has blocked access to that address.

    The trace view shows the data abort is caused by the "LDR r0,[r3,#0]" instruction at 0xCF6, which is trying to load a 32-bit word from the address held in r3.  Set a breakpoint on that instruction and run to it.  Check the value of r3 in the Registers view.  Is it a sensible address?  If so, perhaps the MPU is not being programmed correctly, and access to that memory is accidentally being blocked.  Try temporarily disabling the MPU (either comment out the call to enable_mpu(), or use the Registers view to clear the M bit in the System Control register before executing the LDR).

    I suspect the problem might be related to the placement of __data_end in your gcc.ld.  In startup.S, the MPU config for "Region 1 - Data" should cover both the RW (.data) _and_ ZI (.bss) regions.  I suggest you check that the memory regions programmed in the MPU config code and the corresponding base/limit symbols in your gcc.ld are as expected.

    Hope this helps

    Stephen


Reply
  • Hi again Enzo

    A data abort will occur if an attempt is made to read/write a memory location, but there is no memory at that address, or the MPU has blocked access to that address.

    The trace view shows the data abort is caused by the "LDR r0,[r3,#0]" instruction at 0xCF6, which is trying to load a 32-bit word from the address held in r3.  Set a breakpoint on that instruction and run to it.  Check the value of r3 in the Registers view.  Is it a sensible address?  If so, perhaps the MPU is not being programmed correctly, and access to that memory is accidentally being blocked.  Try temporarily disabling the MPU (either comment out the call to enable_mpu(), or use the Registers view to clear the M bit in the System Control register before executing the LDR).

    I suspect the problem might be related to the placement of __data_end in your gcc.ld.  In startup.S, the MPU config for "Region 1 - Data" should cover both the RW (.data) _and_ ZI (.bss) regions.  I suggest you check that the memory regions programmed in the MPU config code and the corresponding base/limit symbols in your gcc.ld are as expected.

    Hope this helps

    Stephen


Children