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

  • 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

  • FILE_ID AND REC_KEY is not fixed, and you can change them. From the infocenter:

    Record keys should be in the range 0x0001 - 0xBFFF. The value 0x0000 is reserved by the system. The values from 0xC000 to 0xFFFF are reserved for use by the Peer Manager module and can only be used in applications that do not include Peer Manager.

    File IDs should be in the range 0x0000 - 0xBFFF. The value 0xFFFF is used by the system. The values from 0xC000 to 0xFFFE are reserved for use by the Peer Manager module and can only be used in applications that do not include Peer Manager.


    You can use e.g. a different REC_KEY or FILE_ID to group/split your data up.

  • Hello sir,

    will you tell me one thing that can we use direct read write functions in esb_prx function?

    and also tell me that the fds example you had told that is working in sdk 11.0.0.i had tried that example its working fine in sdk 11.0.0. then i have tried by adding fds library in my main code i.e in ble_app_uart in sdk 12.2.0 added all fds function calls i.e write ,fds_read() on my ble_app_uart i had added the fds code same as added in the proximity example. compiled my project with 0 errors.but i noticed that in my fds code the fds_init() function executes continuously.it will not going on the next loop. i am not understanding why it is happening.

    so my main question is that can we use fds in only sdk 11.0.0. or it can be used in sdk 12.2.0.

    Thank you

    Pallavi

  • I see that you have create a case in MyPage regarding this topic. Your question will be handled there. Closing this thread.

Related