2024-02-06 07:59 AM
I want to send the character array button_image[] through uart of NUCLEO-H743ZI2 board to the LCM display.
Please check the attached button_image.c file for your reference where the array is initialised to corresponding hex data.
The array consist of 2076 bytes.
I am using t_bool TransferFlashImage( uint8 *img_data, uint32 img_size, err_code *err); function for flashing the LCM.
In my main.c file, I have declared a pointer as follows:
uint8_t *img_data=button_image;
Now I am expecting img_data is pointing to all the 2076 bytes. But, It is holding only 4 bytes .
I want to send all 2076 bytes through TransferFlashImage(img_data,img_size,err); so that the LCM will be flashed.
Please let me know how I can send all the 2076 bytes to LCM.
Solved! Go to Solution.
2024-02-06 08:02 AM
> Now I am expecting img_data is pointing to all the 2076 bytes. But, It is holding only 4 bytes .
It's pointing to the start of all of them. Maybe whatever you're viewing it in is only showing you the first 4 bytes.
Pointers only point to a memory location. It has no knowledge of the array size, that must be tracked separately. Here, it is tracked by the img_size variable.
2024-02-06 08:02 AM
> Now I am expecting img_data is pointing to all the 2076 bytes. But, It is holding only 4 bytes .
It's pointing to the start of all of them. Maybe whatever you're viewing it in is only showing you the first 4 bytes.
Pointers only point to a memory location. It has no knowledge of the array size, that must be tracked separately. Here, it is tracked by the img_size variable.