I need to use cJSON to parse the uart data. I found the file in SDK15.3 but how can I use the related function?
I need to use cJSON to parse the uart data. I found the file in SDK15.3 but how can I use the related function?
Hi,
just add sources and headers to your project and call functions as usual... you also need to add mem_manager library from SDK. cJSON has a good README with detailed instructions how to use this library.
Is there a routine example of how to use the memory management library?
Standard malloc always allocates a word-aligned block. nrf_malloc will allocate a new block starting from next byte, so if your block size is not word-aligned, allocations will be unaligned too.
Byte alignment of memory! ! ! I know this concept until now. It’s true that the memory block size is set to a multiple of 4 and the problem disappears.
So, my understanding is that the byte alignment principle is followed when using malloc or nrf_malloc, and the memory address is aligned in 4 bytes. Is my understanding correct?
when using malloc
nrf_malloc, and the memory address is aligned in 4 bytes
You mean block size? Yes, in both cases you'll get a word-aligned address.
all right. I got it. Thanks Dmitry!!! I will continue my project.
all right. I got it. Thanks Dmitry!!! I will continue my project.