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

Having problem of region RAM overflowed with stack

Hi, current i'm writing a program in nordic nrf51822 chip and I facing the problem of region RAM overflowed with stack after adding the BLE code as shown below :

//*******************************************************************************************************************

//The Nordic UART Service static const uint8_t service1_uuid[] = {0x71, 0x3D, 0, 0, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; static const uint8_t service1_tx_uuid[] = {0x71, 0x3D, 0, 3, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; static const uint8_t service1_rx_uuid[] = {0x71, 0x3D, 0, 2, 0x50, 0x3E, 0x4C, 0x75, 0xBA, 0x94, 0x31, 0x48, 0xF1, 0x8D, 0x94, 0x1E}; static const uint8_t uart_base_uuid_rev[] = {0x1E, 0x94, 0x8D, 0xF1, 0x48, 0x31, 0x94, 0xBA, 0x75, 0x4C, 0x3E, 0x50, 0, 0, 0x3D, 0x71};

uint8_t tx_value[TXRX_BUF_LEN] ; uint8_t rx_value[TXRX_BUF_LEN] ;

GattCharacteristic characteristic1(service1_tx_uuid, tx_value, 1, TXRX_BUF_LEN, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE ); GattCharacteristic characteristic2(service1_rx_uuid, (uint8_t *)rx_value, sizeof(rx_value), sizeof(rx_value), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);

GattCharacteristic *uartChars[] = {&characteristic1, &characteristic2}; GattService uartService(service1_uuid, uartChars, sizeof(uartChars) / sizeof(GattCharacteristic *));

//*******************************************************************************************************************

Before this, the program able to compile well by showing "Sketch uses 36,820 bytes (18%) of program storage space. Maximum is 196,608 bytes." but after adding the code, then i will be having "region RAM overflowed with stack". I read about some solution that is manipulating with heap but i do not understand how to do it, can someone please guide. Thanks.

Parents Reply Children
No Data
Related