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

`.nrf_queue' will not fit in region `UNPLACED_SECTIONS' on NRF52810

I started from the blinky example for pca10040e (NRF52810) on SDK15.3, added some files and code to get TWI_MNGR working but i get an error which i can't solve

`.nrf_queue' will not fit in region `UNPLACED_SECTIONS'
region `UNPLACED_SECTIONS' overflowed by 20 bytes

Parents
  • Hi,

    You need to add the .nrf_queue section to your flash_placement.xml (placed adjacent to the SES project file) to use the Queue module:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <Root name="Flash Section Placement">
    <MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
    <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
    <ProgramSection alignment="4" load="Yes" name=".init" />
    <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    <ProgramSection alignment="4" load="Yes" name=".text" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".pwr_mgmt_data" inputsections="*(SORT(.pwr_mgmt_data*))" address_symbol="__start_pwr_mgmt_data" end_symbol="__stop_pwr_mgmt_data" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
    ...
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • Hi,

    You need to add the .nrf_queue section to your flash_placement.xml (placed adjacent to the SES project file) to use the Queue module:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <Root name="Flash Section Placement">
    <MemorySegment name="FLASH" start="$(FLASH_PH_START)" size="$(FLASH_PH_SIZE)">
    <ProgramSection alignment="0x100" load="Yes" name=".vectors" start="$(FLASH_START)" />
    <ProgramSection alignment="4" load="Yes" name=".init" />
    <ProgramSection alignment="4" load="Yes" name=".init_rodata" />
    <ProgramSection alignment="4" load="Yes" name=".text" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".pwr_mgmt_data" inputsections="*(SORT(.pwr_mgmt_data*))" address_symbol="__start_pwr_mgmt_data" end_symbol="__stop_pwr_mgmt_data" />
    <ProgramSection alignment="4" keep="Yes" load="Yes" name=".nrf_queue" inputsections="*(.nrf_queue*)" address_symbol="__start_nrf_queue" end_symbol="__stop_nrf_queue" />
    ...
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children
  • Hi,

    Apart from your problem we found a serious bug in nrf_queue library, in function nrf_queue_write.

    In file nrf_queue.c please replace function "static void queue_write(nrf_queue_t const * p_queue, void const * p_data, uint32_t element_count)"

    with following code:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    __STATIC_INLINE size_t circullar_buffer_size_get(nrf_queue_t const * p_queue)
    {
    static const uint8_t full_queue_indicator = 1;
    /* When a queue is implemented as a cyclic buffer, it is not possible to
    * distinguish a full queue from an empty queue. In order to solve this
    * problem, the cyclic buffer has been implemented one element larger than
    * the queue size.
    */
    return p_queue->size + full_queue_indicator;
    }
    /* Purpose of this function is to provide number of continous bytes in the queue's
    * array before circullar buffer needs to wrapp.
    */
    static size_t continous_items_get(nrf_queue_t const * p_queue, bool write)
    {
    size_t front = p_queue->p_cb->front;
    size_t back = p_queue->p_cb->back;
    /* Number of continous items for queue write operation */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX