[STM32F411CEU6] Board definitions

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
lukesky333
Posts: 44
Joined: Fri Sep 02, 2016 4:07 pm
Location: Austria

[STM32F411CEU6] Board definitions

Post by lukesky333 » Tue Nov 12, 2019 8:35 am

Hi,

I've ordered a board at Aliexpress and now I've seen, that there are no board definition yet.
How can I start to create the board definition, which board is a good start for this task?

BOARD: STM32F411CEU6
LINK: https://de.aliexpress.com/item/4000138305460.html

Thanks a lot (again)...

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [STM32F411CEU6] Board definitions

Post by jimmo » Tue Nov 12, 2019 9:19 am

Any of the F411 boards - e.g. PYBLITE10, also there's a F411 Nucleo and a Disco too.

lukesky333
Posts: 44
Joined: Fri Sep 02, 2016 4:07 pm
Location: Austria

Re: [STM32F411CEU6] Board definitions

Post by lukesky333 » Tue Nov 12, 2019 10:24 am

I've seen these boards too. But there are big differences in pin definitions, and I don't know how to handle this correctly.

Especialy the frequency settings - I'm not not sure how and where to find the correct settings for this board.

Can you give me a short introduction, how to calculate these settings?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [STM32F411CEU6] Board definitions

Post by jimmo » Tue Nov 12, 2019 1:21 pm

It depends what you mean by pin definitions? pins.csv is mostly just about what you want to call the pins so you can access them using machine.Pin.board.FOO (i.e. on the Pyboard, the pins are labeled externally as X1, X2, X3...Y1...etc, so pins.csv provides that mapping). On the Nucleo boards, they often use Arduino naming (D0, D1..., A0, etc)

Or if you're talking about the pins in mpconfigboard.h (i.e. which pin UART1 is on etc, then you'll have to look up the STM datasheet for the particular chip (and package) that you're using. But in many cases, the port numbering is the same (i.e. UART2 is on A2/A3) (you'll see that mpconfigboard.h is pretty similar between those three board definitions). However on STM32 a given function (e.g. I2C1 SCL) might be available on different pins (via the "alternate function" mechanism). So this is really a question of how your board is laid out. If I2C1 SCL is available on pins X, Y and Z, but only Y is routed to a header on your board, then you use Y. And on some boards that have way fewer headers than CPU pins, you might not be able to enable all functions.

Hope that makes sense...sorry I don't have an easier answer, but mostly it's just sitting there with the datasheet and the schematic and figuring out what's available.

For the frequency stuff...hopefully one of those three boards uses the same crystal in which case you can copy it. Otherwise I use the STM32CubeMX tool to generate this -- see this thread viewtopic.php?f=12&t=6471&p=36838

lukesky333
Posts: 44
Joined: Fri Sep 02, 2016 4:07 pm
Location: Austria

Re: [STM32F411CEU6] Board definitions

Post by lukesky333 » Tue Nov 12, 2019 2:22 pm

Thanks for your response and yes, that makes sense... :-)

My main question was about the mpconfigboard.h configuration stuff. And I had a look at two boards and the values were more different than expected.

But I found this post, that's all I was looking for. I've searched before, but the search seems to work a little bit different than I was thinking.

Post Reply