Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Porting Keil project to SES

Hi, 

I have a pretty extensive nRF52832, SDK14.2, freertos project built and debugged using Keil MDK.

I'm trying to port this project to SES and experience some problems.

This is what I did - 

  1. I've used SES import wizard to import the Keil project file *.uvproj
  2. Opened a clean HRS_freertos SES session
  3. Based on the clean HRS_freertos example structure started to modify my project's settings:
    1. Replaced Keil's imported \Device startup file with the equivalent (?) set of files taken from the clean example (yellow) -
      from Keil: Device\system_nrf52.c + arm_startup_nrf52.s --> 
      to SES: Device\ses_nrf52_startup.s + ses_nrf52_vectors.s + system_nrf52.c & SeggerStartupFIles\thumb_crt0.s

    2. Replaced RTT file (green):
      from Keil: nrf_Segger_RTT\SEGGER_RTT_Syscalls_Keil.c -->
      to SES: nrf_Segger_RTT\SEGGER_RTT_Syscalls_SES.c 

    3. Noted the 'Internal files' folder added to SES by the import wizard (pink)



  4. However, I can't find the following:
    1. Setting the memory map correctly. 
      • The 'Linker > Section placement file' option does not show in the imported project (it does show in the clean sample project)
      • Even when looking at the clean example 'flash_placement.xml' I don't see how to convert the original memory map


Last, but not least, I've tried to post this thread into Segger's SES forum however I can't find a 'new post' link/button.

Is it just me Grimacing ???

Thanks

Parents
  • EDIT:

    Please see the answer from SEGGER - Johannes below.

    ___________________________________________________________

    Hi.

    The first steps seem correct.

    The 'Linker > Section placement file' option does not show in the imported project (it does show in the clean sample project)

     This one however, is strange. I've ported  a few projects from KEIL to SES, but I haven't experienced that the options does not appear at all.

    You could try to manually add them to your project file;

    1. Open your solution in the editor:

    2. Add the required data in the editor;

     

    Last, but not least, I've tried to post this thread into Segger's SES forum however I can't find a 'new post' link/button.

    I haven't posted anything there myself, but you might need to create an account and wait for a SEGGER - Forum moderator to aprove the account before posting. 
    Maybe  can comment on this?

    Best regards,
    Joakim

Reply
  • EDIT:

    Please see the answer from SEGGER - Johannes below.

    ___________________________________________________________

    Hi.

    The first steps seem correct.

    The 'Linker > Section placement file' option does not show in the imported project (it does show in the clean sample project)

     This one however, is strange. I've ported  a few projects from KEIL to SES, but I haven't experienced that the options does not appear at all.

    You could try to manually add them to your project file;

    1. Open your solution in the editor:

    2. Add the required data in the editor;

     

    Last, but not least, I've tried to post this thread into Segger's SES forum however I can't find a 'new post' link/button.

    I haven't posted anything there myself, but you might need to create an account and wait for a SEGGER - Forum moderator to aprove the account before posting. 
    Maybe  can comment on this?

    Best regards,
    Joakim

Children
  • Hi,

    I haven't posted anything there myself, but you might need to create an account and wait for a SEGGER - Forum moderator to aprove the account before posting. 

    You are right. Once you registered in our forum, your account needs to be activated by us. This is usually done within 24h.

    The 'Linker > Section placement file' option does not show in the imported project (it does show in the clean sample project)

    Since V4.10 Embedded Studio uses the SEGGER Linker instead of the GNU Linker by default.
    You could get back to GNU Linker (and use the Section placement file etc.) by changing the Project Option Linker from "SEGGER" to "GNU".

    But I would recommend to use the SEGGER Linker, especially when you have a more complex memory/placement layout.

    Some background on this:
    The GNU Linker has been designed for computer (Linux) applications and was then adopted for (bare metal) microcontroller applications.
    Because the memory layout and section placements on a microcontroller are more complex then on a PC, GNU Linker Scripts are usually long, complex, and not easily understood. You usually copy and paste from existing linker scripts.
    To make creation of GNU Linker Scripts simpler, Embedded Studio uses the Memory Map and Section Placement files and creates the linker scripts based on this for you.
    Recently SEGGER released its own, new Linker, which has been developed for embedded development, with all specialties of microcontrollers in mind.
    With the SEGGER Linker you can now easily write a linker script with a few lines.
    For more information and examples, have a look at https://www.segger.com/products/development-tools/embedded-studio/technology/tools/segger-linker

    To use the SEGGER Linker in your project, keep your ses_nRF_startup.s and the ses_nRF52_vectors.s, remove the Cortex_M_Startup.s, keep SEGGER_THUMB_Startup.s and remove thumb_crt0.s

    Now you should be ready to develop your project with Embedded Studio.

    Best regards
    Johannes - SEGGER

  • Thank you very much for the helpful answer!

    Hope that clears things up for eyalasko.

    Best regards,
    Joakim Jakobsen

  • Thanks Joakim & Johannes for your super prompt answers.

    I've followed your instructions (was not sure about system_nrf52.c though)

    To use the SEGGER Linker in your project, keep your ses_nRF_startup.s and the ses_nRF52_vectors.s, remove the Cortex_M_Startup.s, keep SEGGER_THUMB_Startup.s and remove thumb_crt0.s

    Now I see in project options>linker that the Segger linker is selected.

    In my Keil project I've used a segment of uninitialized RAM to hold variable that should survive a reset (see screen cap in the original post).

    I've followed vidar's guidelines and set the file's properties and added the following statment in the code:

    static Scratchpad_t scratchpad  __attribute__((section("NoInit"), zero_init));

    How this should be handled in SES ?

    Should I manipulate the *.icf file ?

    Thanks again

  • Hi.

    Sorry about the delay.

    Did you decide on using the SEGGER Linker?

    If so, there should be an example of how to acheive this in the link Johannes provided;
    https://www.segger.com/products/development-tools/embedded-studio/technology/tools/segger-linker

    Under;

    4. Place Sections into Memory

    5. Put Everything Together

Related