2025-06-10 1:25 AM - last edited on 2025-06-10 2:02 AM by Andrew Neil
Hi,
I have a question that might be helpful for many others as well.
I am currently using the MB2046B development board, which features the STM32C071RB microcontroller, along with STM32CubeMX for code generation.
I also have a custom board that uses the STM32C071CBT6 microcontroller.
Will the same code developed for the MB2046B board (with STM32C071RB) work on my custom board that uses the STM32C071CBT6?
if Not can you please tell me the Why it not works for instant we forgrt about the pins
2025-06-10 1:34 AM - edited 2025-06-10 1:36 AM
STM32C071RB vs STM32C071CBT6:
https://www.st.com/resource/en/datasheet/stm32c071rb.pdf#page=128
via: https://www.st.com/en/microcontrollers-microprocessors/stm32c071rb.html
So the only difference is in the number of pins on the package.
Therefore, so long as you restrict yourself to things which are available on both packages, the same code can run on both.
PS:
Of course, you will also have to ensure that your custom board has compatible hardware in corresponding places to the Nucleo.
2025-06-10 1:45 AM
Hello @curiocity ,
You should consider the hardware differences and check the pin mapping.
The STM32C071CBT6 (LQFP48 package) has fewer pins than the STM32C071RB (LQFP64 package).
If your code uses GPIO pins that are not available on the STM32C071CBT6, you will need to remap or modify your code accordingly. So, I recommend verifying the pinout in STM32CubeMX and ensure that all peripherals (e.g., UART, I2C, SPI, ADC) are mapped to pins that exist on the STM32C071CBT6.
Also, check the clock settings.
2025-06-10 2:00 AM
@curiocity wrote:Will the same code developed for the MB2046B board (with STM32C071RB) work on my custom board that uses the STM32C071CBT6?
it also depend on what you mean by "the same code".
If you mean the exact same binary - so with no need to recompile for the different boards - then you would need to ensure that all the pin assignments are identical.
But it is also possible to have a single set of code with compile-time options, so that it can be built for either board - giving you a different binary for each board. This gives you more flexibility in pin assignments, but means you have to manage the two variants.