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

ble app uart problems

hi i have a problem with ble app uart.i used nRF5_SDK_12.3.0_d7731ad and Eclipse Mars 2. I had build main.c in hex ble_app_uart\pca10040\s132 . And after that a maked mergehex with s132_nrf52_3.0.0_softdevice.hex.i flashed into my BLE nitrogen. i can conect to BLE. But any messages what i sended on Bluetooth from my Phone Do not return in my phone but function can do it.And more when i put in condition code for togle blinky i had not any bkinky when i sended mesage from my phone

void uart_event_handle(app_uart_evt_t * p_event)
{
    static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
    static uint8_t index = 0;
    uint32_t       err_code;

    switch (p_event->evt_type)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&data_array[index]));
            index++;

            if ((data_array[index - 1] == 'q') || (index >= (BLE_NUS_MAX_DATA_LEN)))
            {
                //send mesage as resived
                err_code = ble_nus_string_send(&m_nus, data_array, index);
                if (err_code != NRF_ERROR_INVALID_STATE)
                {
                    APP_ERROR_CHECK(err_code);
                }

                index = 0;
            }
            break;

        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_code);
            break;

        default:
            break;
    }
}
Parents
  • proboly sothing wrong with ble_app_uart_gcc_nrf52.ld

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
      RAM (rwx) :  ORIGIN = 0x20002128, LENGTH = 0xded8
    }
    
    SECTIONS
    {
      .fs_data :
      {
        PROVIDE(__start_fs_data = .);
        KEEP(*(.fs_data))
        PROVIDE(__stop_fs_data = .);
      } > RAM
      .pwr_mgmt_data :
      {
        PROVIDE(__start_pwr_mgmt_data = .);
        KEEP(*(.pwr_mgmt_data))
        PROVIDE(__stop_pwr_mgmt_data = .);
      } > RAM
    } INSERT AFTER .data;
    
    INCLUDE "nrf5x_common.ld"
    
Reply
  • proboly sothing wrong with ble_app_uart_gcc_nrf52.ld

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
      RAM (rwx) :  ORIGIN = 0x20002128, LENGTH = 0xded8
    }
    
    SECTIONS
    {
      .fs_data :
      {
        PROVIDE(__start_fs_data = .);
        KEEP(*(.fs_data))
        PROVIDE(__stop_fs_data = .);
      } > RAM
      .pwr_mgmt_data :
      {
        PROVIDE(__start_pwr_mgmt_data = .);
        KEEP(*(.pwr_mgmt_data))
        PROVIDE(__stop_pwr_mgmt_data = .);
      } > RAM
    } INSERT AFTER .data;
    
    INCLUDE "nrf5x_common.ld"
    
Children
No Data
Related