RRDajay / stm32_bluepill_AN4657

IAP Application Note (AN4657) ported for stm32 bluepill
0 stars 0 forks source link

Help in upload code #1

Open sguptaSunmint opened 2 years ago

sguptaSunmint commented 2 years ago

I am uploading bin file using Tera Term but file couldn't be uploaded and no error is showing. Can you help me with it.

RRDajay commented 2 years ago

I tried to upload the code using minicom and it's able to upload the .bin file without any problems. You can use minicom if you have any access to a linux machine.

I'm having the same issues as you are having when using Tera Term. I'm using v4.86 of Tera Term and it seems that the HAL_UART_Receive function always returns a HAL_TIMEOUT, and no data transfer between the device occurs.

asheeshraikwar commented 2 years ago

Is Minicom available on windows?

sguptaSunmint commented 2 years ago

can you please share steps to upload binary through minicom?

RRDajay commented 2 years ago

can you please share steps to upload binary through minicom?

Make sure that you have minicom installed on your machine.

  1. Connect minicom to your device with the command below. Replace the in /dev/tty with the proper port number.

Note: It would be /dev/rfcomm* if you have interfaced the bluepill with a HC-05.

sudo minicom -b 115200 -D /dev/tty*

You can also change the baud rate by changing it inside the usart.c file.

  1. Pull GPIOA1 to GND, and reset the bluepill. This will jump to the bootloader code.

You should see something like this. step1

  1. Press Ctrl-A + Z to open up the minicom menu. Navigate to Send Files>ymodem and choose the .bin file you want to upload. I've included a simple blink led project in the repo for easy verification. You can find the blink.bin file in blink/build/blink.bin.

Is Minicom available on windows?

I'm not sure on this. I originally made this on a linux machine with a Manjaro distro. I wasn't able to verify it with Tera Term. I plugged in a logic analyzer to investigate the communication between the devices and compared it with minicom and Tera Term There seems to be a difference in the SOH byte of ymodem protocol in Tera Term that makes the bluepill to be stuck with a HAL_TIMEOUT.

RRDajay commented 2 years ago

Hi, I've found out that the problem I had was due to my hardware setup. I was originally using a hc-05 with UART1 and that seemed to be the one causing the communication issues I was having. I'm currently using a USB TTL cable and I was able to use Tera Term. I've included a Usage section in the readme on how to use the code.