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

How to start Firmware separated in I-RAM and D-RAM within Cortex-M3 design kit?

Hello?

I'm trying to implement the Firmware with the Cortex-M3 SoC which is separately designed I-RAM and D-RAM  in Keil MDK.

As you can see the above example system, AHB Interconnect have 3 slaves S0, S1 and S2. and S0 and S1 are connected with separated SRAM, especially, If it can be, I'd like to make the firmware to allocate each address region separately.

For example, the system consisted as the below.

S0 address map  0x00000000 ~ 0x0000FFFF

S1 address map  0x00010000 ~ 0x0001FFFF

It means that I'd like to run the I-Code part of firmware into I-Ram and the D-Code part of firmware into D-Ram.

In this case, My question is

1.How to start Firmware separated in I-RAM and D-RAM within Cortex-M3 design kit by using Keil MDK?

2.How to assign or calculate the S0 and S1 addresses region at the first time of initial architecture designing?

3.How to determine the I-RAM and D-RAM size ?

 

Parents
  • Both I-CODE and D-CODE bus see 0x00000000 to 0x1FFFFFFF. The only different is that:

    - I-CODE bus handles instruction fetches and vector fetches

    - D-CODE bus handles data and debug accesses.

    While it is possible to create address decoding logic to have SRAM X visible on I-CODE in address 0x00000000 and SRAM Y visible on D-CODE in address 0x00010000, it doesn't quite work in C programming environment. In C programming environment, the compiler generates literal data inside program image, which need to be accessed as data read/write, so has to be visible from D-CODE. As a result, a program image need to be visible from both I-CODE and D-CODE buses.

    The reason for separating the CODE bus into two physical bus interface is to allow chip designers to create flash access accelerators: for example, it can have flash prefetching logic for I-CODE and literal data cache connect to D-CODE, but both sides need to be merged at the flash / program memory.

    To answer your question:

    A program image for C programming cannot be created with the memory layout you mentioned.  While Keil MDK has an option to create object files that are targeted for eXecute-Only Memory (XOM), C runtime libraries are not designed to support that.

    Assume that you create a program image (that contains both instructions and data), you can find the program memory size requirements from the memory map file (generate in linking stage).

    regards,

    Joseph

Reply
  • Both I-CODE and D-CODE bus see 0x00000000 to 0x1FFFFFFF. The only different is that:

    - I-CODE bus handles instruction fetches and vector fetches

    - D-CODE bus handles data and debug accesses.

    While it is possible to create address decoding logic to have SRAM X visible on I-CODE in address 0x00000000 and SRAM Y visible on D-CODE in address 0x00010000, it doesn't quite work in C programming environment. In C programming environment, the compiler generates literal data inside program image, which need to be accessed as data read/write, so has to be visible from D-CODE. As a result, a program image need to be visible from both I-CODE and D-CODE buses.

    The reason for separating the CODE bus into two physical bus interface is to allow chip designers to create flash access accelerators: for example, it can have flash prefetching logic for I-CODE and literal data cache connect to D-CODE, but both sides need to be merged at the flash / program memory.

    To answer your question:

    A program image for C programming cannot be created with the memory layout you mentioned.  While Keil MDK has an option to create object files that are targeted for eXecute-Only Memory (XOM), C runtime libraries are not designed to support that.

    Assume that you create a program image (that contains both instructions and data), you can find the program memory size requirements from the memory map file (generate in linking stage).

    regards,

    Joseph

Children