[SOLVED] Custom RAMCode for JFlash

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Custom RAMCode for JFlash

    Hello.

    I'm making my own RAMCode for my board on stm32f103 with w25q spi flash.
    As an example from wiki (wiki.segger.com/Open_Flashloader), I try wiki.segger.com/File:ST_STM32F205RC_ES_V310a.zip

    I added the minimum code I needed to work with w25q and it works.
    Total size of Template_CortexM.bin is 5752 bytes.

    To debug some functions, I try to add output data to UART. To format the strings, I add a small xsprintf() function (similar to sprintf(), but simplified). And got the error:

    Source Code

    1. Building 'Template_CortexM' from solution 'Template_CortexM' in configuration 'Release'
    2. 1> Compiling 'FlashPrg.c'
    3. 2> Compiling 'FlashDev.c'
    4. 3> Compiling 'spi.c'
    5. 4> Compiling 'w25q.c'
    6. 1> Compiling 'rcc.c'
    7. 2> Compiling 'uart.c'
    8. 4> Compiling 'xprintf.c'
    9. 1> Link Time Optimization
    10. 1> Generating linker script 'Template_CortexM.ld'
    11. 1> Linking Template_CortexM.elf
    12. 1> /opt/SEGGER/segger_embedded_studio_for_arm_5.32a/gcc/arm-none-eabi/bin/ld: Output/Release/Exe/Template_CortexM.elf section `.text.libc.strlen' will not fit in region `UNPLACED_SECTIONS'
    13. 1> /opt/SEGGER/segger_embedded_studio_for_arm_5.32a/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS' overflowed by 96 bytes
    14. Build failed
    Display All
    As far as I understand, the reason is that the "strlen" function is not placed in the section "PrgCode".


    I don't have enough experience with SES yet, so I couldn't find where it can be configured.
  • Hi,
    Thank you for your inquiry.

    The template is designed to only implement what is necessary for the RAM code to work.
    Usually it is only supposed to write registers and such.Integrating the libc would make the RAM code unnecessarily big.

    The idea of a RAM code is to be as bare metal and small as possible.
    That way a better performance with less size is achieved.

    To integrate a library into the RAM code, you would have to make sure that it is linked correctly.
    As this is not intended, please understand that this is user responsibility, so we cannot provide templates/support for this case.

    We will put this on our feature request list but cannot provide a timeline for it.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,
    Update:
    We added support for this and updated the Cortex-M template accordingly:
    wiki.segger.com/Open_Flashload…ortex-M_template_projects

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.