cancel
Showing results for 
Search instead for 
Did you mean: 

How to send the Multiple bytes through UART for flashing LCM display

sushma
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".