I am creating the Battery characteristic in a Battery service but I run out of memory (0x04 error) when generating the characteristic. However, that makes no sense. I have the same set of characteristics for several different health devices, blood pressure, glucose, spirometer, thermometer, heart rate, and scale. Only the glucose and the spirometer run out of memory generating a characteristic. In the spirometer case, the reg cert data list char fails in the DIS but the Battery Service and battery do not and they are generated after the DIS.
WHen I build in Keil, I get the size of code and it is only 41K bytes. This is small compared to most of the BT SIG profile examples. The program runs fine but those characteristics that don't get created are not part of the service table.
I am not sure how to solve this issue or why it even happens.