Different package MCU of NUCLEO-H743ZI

I use Nucleo- H743ZI , which is used LQFP144 0.5mm pitch package.
Can I compile different packages such as LQFP208 , LQFP176 using Mbed Compiler ?
I want to use a package of leadless .
Thank you.

Yes, check the reference manual and the available pin names that you can use will be shown for each package.

It may be possible that not all the pin names have been specified in the Mbed library, you can check this against the reference manual and here:

1 Like

Hi

Note you can be helped by https://github.com/ARMmbed/mbed-os/blob/master/tools/targets/STM32_gen_PeripheralPins.py script.

$ python genpinmap_mbed.py -m “STM32H743ZITx.xml”

You should get what is currently defined in NUCLEO-H743ZI

$ python genpinmap_mbed.py -m “STM32H743BITx.xml”

You will get pinmap files for the LQFP208 MCU

Jerome

Hi Jerome,

Would this work for every MCU? we’re about to go from the Nucleo-L152RE to our custom PCB that integrates the STM32L151VET6 and we wanted to know if there is any way to do it safely (not modifying the PeripheralPins.c file).

Many thanks for your time and best regards,
Manuel

Yes, STM32_gen_PeripheralPins.py script is working for every MCU

See Add custom board option to STM32 pins generation script by AGlass0fMilk · Pull Request #12797 · ARMmbed/mbed-os · GitHub

Hi Jerome,
Many thanks for your answer. I am not into python (as an electronic engineer I learned just to program in C and C++) and I have no clue on how to run that code, is there any help page where I can follow instructions for running that code in order to generate the peripherals for my design? I understand that, as you said to the original question, if the code I’m working on right now is for the Nucleo-L152RE (having an STM32L152RETx) and we want to change to the STM32L151ZET6, should I write on the windows cmd:

$ python genpinmap_mbed.py -m “STM32L152ZETx.xml”

And this should work, right? I guess I should have something installed in my computer (some python dev pack or similar maybe), and how can I say into that code line that I want to change an specific program, not all the programs in my hard drive?

Sorry for the newby questions, but I’m really lost with python. Many thanks in advance

I agree I have to document more this script.

$ python genpinmap_mbed.py -l | grep STM32L151ZE
STM32L151ZETx.xml
$ python genpinmap_mbed.py -m "STM32L151ZETx.xml"

You will then get 2 files that you can compare with the one you are using from Nucleo L152

Hi Jerome,
I cannot run anything. First of all, the name of the file has changed but this isn’t really a problem . Then, when executing the first line it says it doesn’t recognize ‘grep’, and the second one outputs:

 ! ! ! Cube Mx seems not to be installed or not at the requested location

 ! ! ! please check the value you set for 'CUBEMX_DIRECTORY' in 'cube_path.json' file

even though the path is correctly set (I had to install CubeMX because it doesn’t work with STMCubeIDE).

If I create a blank project with the SMTCubeIDE and take everything in the TARGET_STM folder, would it work with my design without the need of running this script? Because at this moment I see that way easier than running the script


EDIT: I finally could run the script (just the last part because the grep command is not recognized by python, or at least by the version I downloaded). Many thanks for your time!

1 Like

By the way, @jeromecoutant, I don’t know who’s responsible to update the wiki, but some updates would be useful in here: steps to create a new STM32 platform - | Mbed
For example, the files that have to be copied are now different.

Also, comparing the output from the python script with the original from the Nucleo board I was using, the pin definition (such as: PA_0 = 0x00, PB_3 = 0x13… and so on) is not included in the generated PinNames.h file, I’m adding it by hand but I don’t know if I’m leaving behind any alt function pin or if I’m doing it right, so here there is some room to improve the script, in my opinion.

Many thanks for your time and effort!


EDIT:
I will update this post with every other thing I had to change so it is in the same place, for convenience when updating the python script or the wiki.

py script changes:

  • the ADC pinmap should not create the pins with a final b (as ADC_IN0b-> the 4rd parameter of the STM_PIN_DATA_EXT call should be 0 instead of 0b, or at least that b is not recognized when compiling with Keil uVision)
  • the pin definition (such as: PA_0 = 0x00, PB_3 = 0x13… and so on) is not included in the generated PinNames.h file

wiki:

  • The list of files that have to be copied from other target and its location

I agree, I really need to update wiki page asap.

1 Like