This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

fstorage memory allocation in Segger Embedded Studio

On fds_init() I am getting back an "Invalid Data" error code and I'm not sure why.

This is on pca10040, SDK11 and S132 v 2.0

I lifted the example mentioned here -> devzone.nordicsemi.com/.../ and put this in my UART example.

I am using Segger Embedded Studio and I amended the flash placement xml with address symbol and end symbols to enable it to compile.

I have also registered by event handler with fds_register which seems fine but moving to the next step of fds_init yields the error code 0x0000000b or Invalid Data. Tracing the cause back to fds.c this part is causing the fault:

  fds_init_opts_t init_opts = pages_init();

if (init_opts == NO_PAGES)
{
    return FDS_ERR_NO_PAGES;
}

I haven't looked beyond here as I thought I would pause and ask a question since it must be something simple I am missing.

Thanks a lot

[Update on above issue]

Ok, I think the issue is the allocation of memory in flash_placement.xml for Segger Embedded Studio. I have read RK's comment here -> devzone.nordicsemi.com/.../

Since the post above, I started a brand new project just focusing on fstorage using the example here as a base -> devzone.nordicsemi.com/.../ . I got the error "region `UNPLACED_SECTIONS' overflowed by 17 bytes" message

I then amended the flash_placement_xml as follows:

    <MemorySegment name="$(FLASH_NAME:FLASH)">
....
    <ProgramSection alignment="4" load="Yes" runin=".fs_data_run" name="fs_data" />
</MemorySegment>

<MemorySegment name="$(RAM_NAME:RAM);SRAM">
....
    <ProgramSection alignment="4" load="No" name=".fs_data_run" address_symbol="__start_fs_data"  end_symbol="__stop_fs_data" />
</MemorySegment>

[Update] I also updated thumb_crt0.o as RK suggested in the comment in the forum linked above. Unfortunately after making all of those changes I am still getting

> /Applications/SEGGER Embedded Studio 2.16a/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS' overflowed by 17 bytes

Is there any guidance on how to set up the flash placement when using fstorage? There are snippets in the forum, but it would be good if there was one "OK, this is what you need to do...", perhaps added to the tutorial on setting up Segger Embedded Studio. It seems the only thing holding SES back from being really good are issues around memory allocation.

Thanks

Parents
  • Hi RK, yes I amended the thumb_crt0.s since my original post, still no luck.

      ldr r2, =__rodata_end__
      bl memory_copy
      ldr r0, =__tdata_load_start__
      ldr r1, =__tdata_start__
      ldr r2, =__tdata_end__
      bl memory_copy
      ldr r0, =__fs_data_load_start__
      ldr r1, =__fs_data_start__
      ldr r2, =__fs_data_end__
      bl memory_copy
    

    It's a shame, it feels that SES is a little behind the curve to make it an IDE worth sticking with unless you want to become a real expert in it, which I don't really. So while it is quick and easy to get it up and running you quickly run into its limitations and it starts to feel it may have been better just to stick with Eclipse all along.

Reply
  • Hi RK, yes I amended the thumb_crt0.s since my original post, still no luck.

      ldr r2, =__rodata_end__
      bl memory_copy
      ldr r0, =__tdata_load_start__
      ldr r1, =__tdata_start__
      ldr r2, =__tdata_end__
      bl memory_copy
      ldr r0, =__fs_data_load_start__
      ldr r1, =__fs_data_start__
      ldr r2, =__fs_data_end__
      bl memory_copy
    

    It's a shame, it feels that SES is a little behind the curve to make it an IDE worth sticking with unless you want to become a real expert in it, which I don't really. So while it is quick and easy to get it up and running you quickly run into its limitations and it starts to feel it may have been better just to stick with Eclipse all along.

Children
No Data
Related