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.

Issues related to Memory Mapping, Register access from M3 using SysBios and Syslink.

Other Parts Discussed in Thread: SYSBIOS

Hi,

I am writing some code to run on M3 using Syslink and involves interactions with SysBios.

I have few questions,

1) How do we obtain a continuous chunk of physical memory using SysBios.Do we have some API calls for the same?.

     Basically i wanted to know how do we do memory mapping in SysBios. Does SysBios provides Physical to Virtual mappings?

2) How can we access peripheral device registers from M3. We basically want to test by modifying some Register bits,then access it and confirm that they have changed. My understanding is that the below code should ideally read a register from M3. Could you please confirm this?

unsigned int val = 1;

unsigned int REG_VER = 0x4A100600;

val = (*(volatile uint32_t *)(REG_VER));

While reading a register value continuously from A8  to verify whether register writes  from M3 is getting updated, I get the below error. is this anyway related to some mapping?

Cortex_M3_RTOS: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.0.569.0)

3) How can we create a library project that gives me output (.aem3) for M3.We want to then link this library to an application which will give me .xem3  binary.

We are able  to create an application project that gives me .xem3 binary using command line (make file). But I also want a library project that gives me .aem3 output and I should be able to build this library project using command line (make files) and not from CCS IDE.

Regards,

Heramb

  • Heramb,

    What device are you using?  What OS is running on the A8 you mention?  What versions of the different components (SysLink, SYS/BIOS, XDCtools) are you using?

    I have some first comments from the SYS/BIOS-perspective below.  I expect the SysLink team may chime in too, once we have some more details on your application.

    1) No, SYS/BIOS does not manage physical/virtual mappings.  But on some devices it can configure an MMU based upon an application-specified static configuration.  SYS/BIOS itself doesn’t comprehend what the composition of a memory buffer is “on the other side” of an MMU, i.e., whether it is truly contiguous memory or not.


    2) That looks like it should work.  Typically I’ll do something like this with a REG macro:

    #define REG(x) (*((volatile UInt32 *)(x)))

    #define MY_REG   0x4A100600

    val = REG(MY_REG);


    Yes, I think that error could be due to incorrect memory mapping that caused a memory access fault.


    3) To create a library from a makefile you’ll need to define an archive target (listing the objects to be included) that is built using the archive utility from the code generation tools.  If you want an example of such a makefile you can build a SYS/BIOS application with the ‘custom’ build flow (with BIOS.LibType_Custom, described in the section “Compiler and Linker Optimization” in Bios_User_Guide.pdf), that will compile relevant SYS/BIOS sources for the application and put them in a library that gets linked to the application code.  Build a SYS/BIOS example using BIOS.LibType_Custom in a CCS project, and then look at the file src/sysbios/makefile.  This is more than you need, but it is an example of building a library with a makefile.


    Scott

  • Heramb,

    You will need to map the address 0x4A100600 into the M3's AMMU in order to access it. If you run a SysLink example, we already map the L3 peripherals (0x48000000 - 0xA9FFFFFF) into the AMMU, but your address is just beyond this range. You could either increase the default mapping from 32MB to 512MB, or add a new mapping for your address range.

    The SysLink examples are in SysLink_2_20_02_20/examples/archive. If you are using an old SysLink release, you might not have the examples folder (they were added late). Just download the latest SysLink release to get access to the examples.

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/

    For an example of configuring the AMMU, look in

    examples/archives/TI814X_linux_elf/ex02_messageq.zip
    ex02_messageq/dsp/Dsp.cfg

    Look for the following code:

    /* map L3 peripherals into ammu (non-cacheable) */
    var entry = AMMU.largePages[0];
    entry.pageEnabled = AMMU.Enable_YES;
    entry.translationEnabled = AMMU.Enable_NO;
    entry.logicalAddress = 0x48000000;
    entry.size = AMMU.Large_32M;
    entry.L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;

    ~Ramsey

  • Thanks a lot for the information.This was indeed quite helpful.!

    I also want to know how do we obtain a continuous chunk of physical memory using SysBios. Do we have some API calls for the same like how we used to have mmap( ) in QNX.?.I am having QNX on A8 side.I want to know how can we achieve memory mappings with SysBios on M3 side as memory management is very important  to us.Please let know.

    Also Versions of Different components being used:

    SysLink 2.20.02.20
    XDCtools 3.23.03.53
    SYS/BIOS 6.33.05.46
    IPC 1.24.03.32


    Regards

    Heramb



  • SysBios memory management works on physical  addresses and will always allocate contiguous blocks of memory.