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.

Error[e104]: Failed to fit all segments into specified ranges.(BLE4.0)

Other Parts Discussed in Thread: CC2540

Dear all:

I downloaded MasterSlaveSW in TI's Wiki ,and then adding UART which I used HAL's API,sellecting  DMA .However, the following hapens .

Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment XDATA_N. Unable to place 2 block(s) (0xc02 byte(s) total) in  .0xa13 byte(s) of memory. The problem occurred while processing the segment placement command "-P(XDATA)XDATA_N=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:14ed-1eff"


I was writing IAR sometimes encounting a problem. About BLE4.0,

These paragraph in literal is not enough memory.

the XDATA: 14ed-1eff (2578 bytes), but 2 block (s) (, 0xc02 byte (s) total)(3047bytes),so it doesn't fit it memory.

Does everybody  has the experience in this field? I want  to ask everybody  how to solve this part?


I would be very grateful.

thanks !

  • Hello,

    I assume you are refering to this project, CC254x-1.2_masterSlaveSwitch2 and you added the hal_uart driver

    Which project are you using for your build?
    - CC2540
    - CC2540F128

    Are you building it with BLE Stack 1.3?  

    It seems that you need more RAM space.

    How big are your RX and TX UART buffers?
    Have you tried to reduce the size of these buffers?

    LPRF Rocks the World

    • Hi,

      In fact ,my buffer is setting less than 5 bytes!however ,the maximum RAM is 8k bytes. Maybe I have to reduce my code.

      I sellect CC2540-mini-kefob to build!In the meanwhile, I want to asking you What is it difference  between project  - CC2540  and - CC2540F128

      I am building it with BLE Stack 1.2 .

      Thanks,LPRF Rocks the World.

  • This Err  may cause by buffer using by UART DMA too large.

    try to find _hal_uart_dma.c and reduce  2 defined paras value below (  it may be default 255) . For example:

    HAL_UART_DMA_RX_MAX =64;//255
    HAL_UART_DMA_TX_MAX =64;//255

    that mean you using 128 byte= 64tx + 64rx  of Xdata Ram for uart dma circuit buffer. 

    best regard!!!