cancel
Showing results for 
Search instead for 
Did you mean: 

USB Hal after sending 0 from PC to STM resets the remaining bytes.

daw ka
Associate II
Posted on May 10, 2018 at 11:12

Hello,

I have a small big problem. I configured my stm32 (F429) in CubeMx, everything works after sending positive data from the computer to STM32, but sending 0 resets the remaining bytes.

E.g:

I send: 1 2 3 4 5 0 7 8

I receive: 1 2 3 4 5 0 0 0

Can I change it? If I can do how?

Thanks for help

3 REPLIES 3
Slemi
Associate II
Posted on May 10, 2018 at 13:35

Are you sending ascii values of these numbers or just numbers? I believe sending value 0 not ascii 48 which is ascii value of number 0 will tell your program that this is the last character in series and it won't send out any more data.

Posted on May 10, 2018 at 15:53

I'm sending just numbers. Can I change it somehow?

Posted on May 11, 2018 at 10:01

You can simply try to add 48 to each number before sending and subtract 48 after receiving.