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

CortexM3

I have a very simple CortexM3 based virtual platform example as below

The amba_pv_m2 is connected to a memory in the top. The BusDecoder master port address range is 0x0-0x3FFFFFFF

I have the following C program

#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("Hello!!!\n");
    return 0;
}

and the following make commands

armcc --cpu=Cortex-M3 -g -O2 -c -o hello.o hello.c
armlink --cpu=Cortex-M3 --ro-base 0x00000000  -o hello.axf hello.o

With that when I load the axf into the core and execute, I see the Hello is printed.

Bow I want to load the SW at 0x40000000. For that I did the following chnages

- BusDecoder master port address range 0x40000000-0x7FFFFFFF and make command as

armcc --cpu=Cortex-M3 -g -O2 -c -o hello.o hello.c
armlink --cpu=Cortex-M3 --ro-base 0x40000000  -o hello.axf hello.o

with that the when I run the platform, it stucks somewhere and I am not getting the Hello output.

It seems I am missing some thing here.

Can you guys help me on this ?

Thanks

Khushi

Parents
  • A few things to add:

    Cortex-M3's initial vector table address is fixed at address 0x00000000. (This is different in Cortex-M7/M23/M33, which allows the initial vector table address to be configured by chip designers.

    Startup code usually contain vector tables as well as some startup related code.

    Example startup code for Cortex-M3 can be found in CMSIS github

    https://github.com/ARM-software/CMSIS_5/tree/develop/Device/ARM/ARMCM3/Source

    As Vanhealsing mentioned, the architecture used by Cortex-M processors has a predefined memory map, and address 0x40000000 is predefined as peripheral region and cannot be used for program code storage (same restriction for Device and system spaces).  The predefined memory map simplifies startup as you don't need to configure which region to be cacheable.

    regards,

    Joseph

Reply
  • A few things to add:

    Cortex-M3's initial vector table address is fixed at address 0x00000000. (This is different in Cortex-M7/M23/M33, which allows the initial vector table address to be configured by chip designers.

    Startup code usually contain vector tables as well as some startup related code.

    Example startup code for Cortex-M3 can be found in CMSIS github

    https://github.com/ARM-software/CMSIS_5/tree/develop/Device/ARM/ARMCM3/Source

    As Vanhealsing mentioned, the architecture used by Cortex-M processors has a predefined memory map, and address 0x40000000 is predefined as peripheral region and cannot be used for program code storage (same restriction for Device and system spaces).  The predefined memory map simplifies startup as you don't need to configure which region to be cacheable.

    regards,

    Joseph

Children
No data