How i can get the Softdevice memory map?

Hi all,

Please refer below my development info.

 softdevice : s132 nrf52_6.1.1

 SDK : nRF5_SDK15.3.0

 Board : customized board(Using internal clock, NRF52832)

I added external nor flash(8Mbits) to my board.


External flash can store some data and display it when users connect their own phones.

I am now debugging this firmware. but there are some problems.

if the connection is lost when i am reading data from the external storage flash, the BLE stops.

Here is the keil debug mode assembly.

In this situation, there are no reactions of button or timeout.

0x0000DE6A is softdevice area. So, i can't handle it.

and,

I used sniffer.

this is the log.


actually, i am not used to debugging in this program.

i don't know why my board run strange.

Could i get the softdevice memory map?

or any suggestions?

thanks

Best Regards,

Parents Reply
  • YoungMin said:
    So, Could I think that this problem is caused by notification being disabled during sending data?

    I'm not seeing the central disabling it, so from the peripheral side of things, it shouldn't be an issue to continue sending notifications. The NRF_ERROR_RESOURCES code means that the internal notification buffer in the SoftDevice is full, and you need to wait before you can queue more packets. 

    1) How does your function that calls ble_nus_data_send() looks like? how do you handle the NRF_ERROR_RESOURCES code?

    2) What is NRF_SDH_BLE_GAP_EVENT_LENGTH and NRF_SDH_BLE_GAP_DATA_LENGTH set to in sdk_config.h ?

    Try setting NRF_SDH_BLE_GAP_EVENT_LENGTH to 300 and NRF_SDH_BLE_GAP_DATA_LENGTH to 251

Children
  • 1) my code almost be like example code. 

    void sapp_nus_send(void) // BLE <-> Phone
    {
    	uint32_t err_code = NRF_SUCCESS;
    //	NRF_LOG_INFO(" sapp_nus_send");
    	uint16_t len = 0;
    	uint8_t	send_msg_ready[BLE_NUS_MAX_DATA_LEN] = {0,};
    	uint8_t i;
    	nus_send_cnt = 0;
    	len = queue_get_count(&queue_ble_to_phone);
    	if(len) //
    	{
    		if(!Aging_para)
    		{
    			if(len > sizeof(send_msg_ready)) len = sizeof(send_msg_ready);
    //			NRF_LOG_INFO("Nus_len : %d",len);
    			for(i = 0; i < len; i++)
    			{
    					queue_pull(&queue_ble_to_phone, &send_msg_ready[i]);
    			}
    			do
    					{
    							uint16_t length = (uint16_t)len;
    							err_code = ble_nus_data_send(p_nus, send_msg_ready, &length, m_conn_handle);
    							nus_send_cnt++;
    							if(nus_send_cnt > 0xFFF0)
    								NVIC_SystemReset();
    							if ((err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_RESOURCES) && (err_code != NRF_ERROR_NOT_FOUND))
    							{
    									APP_ERROR_CHECK(err_code);
    							} 
    					} 
    					while (err_code == NRF_ERROR_RESOURCES);
    			}
    			else if(Aging_para)
    			{
    					play_read();
    					sapp_ble_flush();
    					sapp_phone_flush();
    					sapp_uart_flush();
    			}
    	}
    	APP_ERROR_CHECK(err_code);
    }

    2) my settings are NRF_SDH_BLE_GAP_EVENT_LENGTH = 6 and NRF_SDH_BLE_GAP_DATA_LENGTH  = 251.

    i try to change NRF_SDH_BLE_GAP_EVENT_LENGTH to 300 you mentioned, but the board can't start.

    I added a nus timer. NVIC_SystemReset runs when the nus timer exceeds the limit.

    but after NVIC_SystemReset, the system is off.I don't know why.

    thanks for your help.

    Best Regards,

  • YoungMin said:
    i try to change NRF_SDH_BLE_GAP_EVENT_LENGTH to 300 you mentioned, but the board can't start.

    After updating this, you likely need to allocate more RAM to the SoftDevice. See this post: https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory

    YoungMin said:
    but after NVIC_SystemReset, the system is off.I don't know why.

    You can try sd_nvic_SystemReset() instead, and see if that have any affect. When the system restarts, it should start advertising again.

Related