xpack-dev-tools / qemu

A fork of the QEMU project, used to build the xPack QEMU ARM
Other
34 stars 16 forks source link

Add support for stm32 bluepill #3

Closed Javier-varez closed 4 years ago

ilg-ul commented 4 years ago

Thank you for the patch, it seems that no functional changes were needed, only the board definition, right?

Javier-varez commented 4 years ago

Hi,

That's right. However I notice that there is a minor change in the microcontroller model (STM32F103C8T6), which has 64 kB of Flash instead of 128 kB for STM32F103RB. They share the same SVD file.

I have created the model for the MCU and updated the board to use it.

Best regards, Javier Alvarez

ilg-ul commented 4 years ago

I managed to update the build procedure for the new xPack Build Box v3.1 (basically new Docker images).

In preparation for the next release, if you have no additions/changes to this PR, I'm ready to merge it.

Is it ok?

Javier-varez commented 4 years ago

Hi Liviu,

Yes, this is the latest revision, ready to merge. Thanks a lot!

BR, Javier Álvarez

ilg-ul commented 4 years ago

Done, thank you. I'll check it tomorrow.

ilg-ul commented 4 years ago

The emulation if functional, but, if I read the schematics right, the led turns on when the GPIO pin is set to 0.

And the colour is GREEN.

I also slightly changed the board name.

https://github.com/xpack-dev-tools/qemu/commit/9835ebb51f07935419e05ed5c8184bc50d0370a8

Javier-varez commented 4 years ago

That's strange. I have the board and the LED is actually red. I guess they may be manufactured with different LED colors depending on availability. Regarding if it's active low, you are completely right. I tested this with a blinky, but forgot to check polarity, sorry about that.

ilg-ul commented 4 years ago

Actually I did not find the authoritative documentation for the BluePill, only some examples where it was mentioned RED for power, GREEN for user.

Who designed it? I guess there are many chinese clones, but is there an official vendor?

Javier-varez commented 4 years ago

Yeah, that's a good point. I was never able to find an official vendor for this board. It probably originated from some Chinese company, but no one seems to claim ownership of the design.

As far as documentation goes, I was able to find this source, which seems to have a comprehensive amount of data about it: https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill

ilg-ul commented 4 years ago

https://www.youtube.com/watch?v=jLTi2YchcxA

shows a green led blinking.