This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to set ram size in keil for nrf51822?

hello, i am using ble_uart_app project in that i have added the pwm feature and added my code. i have tested my code seperately it works fine but when i have added in the ble_app_uart folder my ble connection getting disconnected and in nrf toolbox in uart i had seen the log it shows gatt error(0x85) will you please tell me why this is happening?why my bluetooth connection gets disconnected. i have attached map file here please refer this and please tell me is there any ram issue due to which my device is getting disconnected. the map file is as follows:

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   

     23476       1898        416        280       3864     508922   Grand Totals
     23476       1898        416        280       3864     508922   ELF Image Totals
     23476       1898        416        280          0          0   ROM Totals

==============================================================================

    Total RO  Size (Code + RO Data)                23892 (  23.33kB)
    Total RW  Size (RW Data + ZI Data)              4144 (   4.05kB)
    Total ROM Size (Code + RO Data + RW Data)      24172 (  23.61kB)

i have just added grand total please refer it and tell me if it is ram issue. and give me the suggestion how i can change it vin keil compiler.please forward me detailed memory map of nrf51822.

Thank you,

Pallavi

Parents
  • sir i am trying with that example but i want to store my data in perticular format.i.e there are 15 arrays i want to store and data around 150 bytes but there is only one method given i.e to werite on fds.i want to ask is it possible to store no of different arrays in the fds and there are seperated by 0x36 0x36 data .but the fds code i had seen writes data on flash in one stroke. please tell me how can i store no of arrays one after another.and in between that how can i add 0x36 0x36 data because i also want to read that data.is it

    #define FILE_ID 0x1111

    #define REC_KEY 0x2222

    changable or it is fixed.

    i want to store these array with 0x36,0x36 in between two different array and read these array how it is possible.

    void write_samsung_ac_data_to_flash(void)
    {
    unsigned int *address1;
    
    unsigned char SAMSUNG_ARP[] ="H1B56H2H1B56H2H1B56SCH1B56H2H1B56S";   //this is ARP that tells the format of the protocol.
    
    //String SAMSUNG_ARP ="H1B56SCH1B48S";   //this is ARP that tells the format of the protocol.
    
    uint8_t SAMSUNG_header[] = {0x0C,0x1C,0x23,0x82,0x02,0x12,0x09,0x9C,0x02,0x12}; // this is the header duration of the protocol
    
    uint8_t SAMSUNG_mark[] = {0x02,0x12,0x02,0x12,0x02,0x12,0x05,0xFA}; // these are the mark duration of the protocol
    
    uint8_t SAMSUNG_ACIRcode[]= {0x40,0x49,0xF0,0x00,0x00,0x00,0x0F,0x80,0x4B,0x75,0x8E,0x00,0xD8,0x0F}; // this is the fixed code of the protocol
    
    uint8_t SAMSUNG_temp[] = {0x00,0x08,0x04,0x0C,0x02,0x0A,0x06,0x0E,0x01,0x09,0x05,0x0D,0x03,0x0B,0x07};//this is the temperature data of the protocol
    uint8_t SAMSUNG_mode[] = {0xD8,0xB0};  //this is the mode data of the protocol
    uint8_t SAMSUNG_fan[] = {0xD8,0x98,0xA8,0x88}; ////this is the fan data of the protocol
    uint8_t SAMSUNG_swing[] = {0x75,0x7F}; // //this is the swing data of the protocol
    uint8_t SAMSUNG_power[] = {0x4D,0x49}; ////this is the power data of the protocol
    uint8_t SAMSUNG_checksum_number = 0x11;
    uint8_t SAMSUNG_temp_position = 0x0B;//this is the temperature position in the main data array
    uint8_t SAMSUNG_mode_position = 0x0C;//this is the mode position in the main data array
    uint8_t SAMSUNG_fan_position = 0x0C;//this is the FAN position in the main data array
    uint8_t SAMSUNG_swing_position = 0x09;//this is SWING mode position in the main data array
    uint8_t SAMSUNG_power_position = 0x01;//this is the POWER position in the main data array
    uint8_t SAMSUNG_checksum_position = 0x08;//this is the CHECKSUM position in the main data array
    uint8_t SAMSUNG_byte_approach_flag = 0xAC;//if any particular bit in this byte is set then that particular feature will add their data in a byte to that particular code ORDER :PMTFSCXX
    uint8_t SAMSUNG_temp_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_mode_structure = 0x0F;//this tells that data bits in their particular position
    uint8_t SAMSUNG_fan_structure = 0xF0;//this tells that data bits in their particular position
    uint8_t SAMSUNG_swing_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_power_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_checksum_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_whole_code_status = 0x08;//this flag will tell that which features out of whole in the A/C use the whole code for their respective change again order is same as above
    uint8_t SAMSUNG_special_condition = 0x1F;//this will tell the code to execute the particular condition written in the code
    uint8_t SAMSUNG_modify_write_flg = 0x80; //IF 1 THEN WRITE  DATA TO EEPROM ELSE NOT
    uint8_t SAMSUNG_double_arp_flg = 0x80; //IF 1 THEN WRITE  DATA TO EEPROM ELSE NOT
    uint8_t SAMSUNG_double_arp=0xFF;
    address1=AC_address;
    write_AC_data(address1,SAMSUNG_ARP,(sizeof(SAMSUNG_ARP)-1),SAMSUNG_header,sizeof(SAMSUNG_header),SAMSUNG_mark,sizeof(SAMSUNG_mark),SAMSUNG_ACIRcode,sizeof(SAMSUNG_ACIRcode),
                  SAMSUNG_temp,sizeof(SAMSUNG_temp),SAMSUNG_mode,sizeof(SAMSUNG_mode),SAMSUNG_fan,sizeof(SAMSUNG_fan),
                  SAMSUNG_swing,sizeof(SAMSUNG_swing),SAMSUNG_power,sizeof(SAMSUNG_power),SAMSUNG_checksum_number,
                  SAMSUNG_temp_position,SAMSUNG_mode_position,SAMSUNG_fan_position,SAMSUNG_swing_position,
                  SAMSUNG_power_position,SAMSUNG_checksum_position,SAMSUNG_byte_approach_flag,SAMSUNG_temp_structure,
                  SAMSUNG_mode_structure,SAMSUNG_fan_structure,SAMSUNG_swing_structure,SAMSUNG_power_structure,SAMSUNG_checksum_structure,
                  SAMSUNG_whole_code_status,SAMSUNG_special_condition,SAMSUNG_modify_write_flg,SAMSUNG_double_arp_flg,SAMSUNG_double_arp);
    			//printf("\r\ndata write on flash!\r\n");
    
    }
    

    Thank You,

    Pallavi

Reply
  • sir i am trying with that example but i want to store my data in perticular format.i.e there are 15 arrays i want to store and data around 150 bytes but there is only one method given i.e to werite on fds.i want to ask is it possible to store no of different arrays in the fds and there are seperated by 0x36 0x36 data .but the fds code i had seen writes data on flash in one stroke. please tell me how can i store no of arrays one after another.and in between that how can i add 0x36 0x36 data because i also want to read that data.is it

    #define FILE_ID 0x1111

    #define REC_KEY 0x2222

    changable or it is fixed.

    i want to store these array with 0x36,0x36 in between two different array and read these array how it is possible.

    void write_samsung_ac_data_to_flash(void)
    {
    unsigned int *address1;
    
    unsigned char SAMSUNG_ARP[] ="H1B56H2H1B56H2H1B56SCH1B56H2H1B56S";   //this is ARP that tells the format of the protocol.
    
    //String SAMSUNG_ARP ="H1B56SCH1B48S";   //this is ARP that tells the format of the protocol.
    
    uint8_t SAMSUNG_header[] = {0x0C,0x1C,0x23,0x82,0x02,0x12,0x09,0x9C,0x02,0x12}; // this is the header duration of the protocol
    
    uint8_t SAMSUNG_mark[] = {0x02,0x12,0x02,0x12,0x02,0x12,0x05,0xFA}; // these are the mark duration of the protocol
    
    uint8_t SAMSUNG_ACIRcode[]= {0x40,0x49,0xF0,0x00,0x00,0x00,0x0F,0x80,0x4B,0x75,0x8E,0x00,0xD8,0x0F}; // this is the fixed code of the protocol
    
    uint8_t SAMSUNG_temp[] = {0x00,0x08,0x04,0x0C,0x02,0x0A,0x06,0x0E,0x01,0x09,0x05,0x0D,0x03,0x0B,0x07};//this is the temperature data of the protocol
    uint8_t SAMSUNG_mode[] = {0xD8,0xB0};  //this is the mode data of the protocol
    uint8_t SAMSUNG_fan[] = {0xD8,0x98,0xA8,0x88}; ////this is the fan data of the protocol
    uint8_t SAMSUNG_swing[] = {0x75,0x7F}; // //this is the swing data of the protocol
    uint8_t SAMSUNG_power[] = {0x4D,0x49}; ////this is the power data of the protocol
    uint8_t SAMSUNG_checksum_number = 0x11;
    uint8_t SAMSUNG_temp_position = 0x0B;//this is the temperature position in the main data array
    uint8_t SAMSUNG_mode_position = 0x0C;//this is the mode position in the main data array
    uint8_t SAMSUNG_fan_position = 0x0C;//this is the FAN position in the main data array
    uint8_t SAMSUNG_swing_position = 0x09;//this is SWING mode position in the main data array
    uint8_t SAMSUNG_power_position = 0x01;//this is the POWER position in the main data array
    uint8_t SAMSUNG_checksum_position = 0x08;//this is the CHECKSUM position in the main data array
    uint8_t SAMSUNG_byte_approach_flag = 0xAC;//if any particular bit in this byte is set then that particular feature will add their data in a byte to that particular code ORDER :PMTFSCXX
    uint8_t SAMSUNG_temp_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_mode_structure = 0x0F;//this tells that data bits in their particular position
    uint8_t SAMSUNG_fan_structure = 0xF0;//this tells that data bits in their particular position
    uint8_t SAMSUNG_swing_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_power_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_checksum_structure = 0x00;//this tells that data bits in their particular position
    uint8_t SAMSUNG_whole_code_status = 0x08;//this flag will tell that which features out of whole in the A/C use the whole code for their respective change again order is same as above
    uint8_t SAMSUNG_special_condition = 0x1F;//this will tell the code to execute the particular condition written in the code
    uint8_t SAMSUNG_modify_write_flg = 0x80; //IF 1 THEN WRITE  DATA TO EEPROM ELSE NOT
    uint8_t SAMSUNG_double_arp_flg = 0x80; //IF 1 THEN WRITE  DATA TO EEPROM ELSE NOT
    uint8_t SAMSUNG_double_arp=0xFF;
    address1=AC_address;
    write_AC_data(address1,SAMSUNG_ARP,(sizeof(SAMSUNG_ARP)-1),SAMSUNG_header,sizeof(SAMSUNG_header),SAMSUNG_mark,sizeof(SAMSUNG_mark),SAMSUNG_ACIRcode,sizeof(SAMSUNG_ACIRcode),
                  SAMSUNG_temp,sizeof(SAMSUNG_temp),SAMSUNG_mode,sizeof(SAMSUNG_mode),SAMSUNG_fan,sizeof(SAMSUNG_fan),
                  SAMSUNG_swing,sizeof(SAMSUNG_swing),SAMSUNG_power,sizeof(SAMSUNG_power),SAMSUNG_checksum_number,
                  SAMSUNG_temp_position,SAMSUNG_mode_position,SAMSUNG_fan_position,SAMSUNG_swing_position,
                  SAMSUNG_power_position,SAMSUNG_checksum_position,SAMSUNG_byte_approach_flag,SAMSUNG_temp_structure,
                  SAMSUNG_mode_structure,SAMSUNG_fan_structure,SAMSUNG_swing_structure,SAMSUNG_power_structure,SAMSUNG_checksum_structure,
                  SAMSUNG_whole_code_status,SAMSUNG_special_condition,SAMSUNG_modify_write_flg,SAMSUNG_double_arp_flg,SAMSUNG_double_arp);
    			//printf("\r\ndata write on flash!\r\n");
    
    }
    

    Thank You,

    Pallavi

Children
No Data
Related