Skip to content

Variant addition: Nucleo-64 L412RB_P #2713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

askuric
Copy link

@askuric askuric commented Apr 17, 2025

Summary

This PR adds the support for the nucleo l412rb_p variant.
And for the generic family associated with it (L412RBIxP and L412RBTxP)

It is realted to these issues:

Which have been merged within this issue:

Validation

  • The code has been tested using the CheckVariant example:

The built-in led blinks and this is the serial output:

####
NUM_DIGITAL_PINS = 50
NUM_ANALOG_INPUTS = 13
#####
Checking digital pins...
End check digital pins
#####
Checking analog pins definition...
End check analog pins
#####
Checking IP instances (I2C, UART, SPI)...
End check IP instances (I2C, UART, SPI)

########################################
#### Test PASSED
########################################
  • The nucleo has been tested using SimpleFOC library (ADC+PWMs) and everything seems to work well.

Code formatting

I'm happy to adapt it to your requirements if needed.

@fpistm fpistm self-requested a review April 17, 2025 10:12
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @askuric
Thanks the PR. Nice job.
Small comments to fix and ideally would prefers 2 commits one for the generic part and one for the variants.

@@ -704,7 +705,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
| Status | Device(s) | Name | Release | Notes |
| :----: | :-------: | ---- | :-----: | :---- |
| :green_heart: | STM32L412K8<br>STM32L412KB<br>STM32L422KB | Generic Board | *2.0.0* | |
| :green_heart: | STM32L431CB<br>STM32L431CC | Generic Board | *2.8.1* | |
| :yellow_heart: | STM32L412RBIxP<br>STM32L412RBTxP | Generic Board | **2.11.0** | |
| :green_heart: | STM32L431CB<br>STM32L431CC | Generic Board | *2.8.1* | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should not be changed.

@@ -16383,4 +16416,4 @@ STeaMi.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
STeaMi.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
STeaMi.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
STeaMi.menu.rtlib.full=Newlib Standard
STeaMi.menu.rtlib.full.build.flags.ldspecs=
STeaMi.menu.rtlib.full.build.flags.ldspecs=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here don't know why it is changed,

Comment on lines +63 to +65
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET

This allows to use a bootloader if needed. Moreover RAM2 is contiguous to the RAM, like this you benefit from all space. User can easily redefine the LD_MAX_DATA_SIZE using board.local.txt if it need to use RAM2 for specific purpose.
image

. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* This is used by the startup in order to initialize the .bss secion */
/* This is used by the startup in order to initialize the .bss section */

This was linked to issues Apr 17, 2025
#define TIMER_TONE TIM6
#endif
#ifndef TIMER_SERVO
#define TIMER_SERVO TIM7
Copy link
Member

@fpistm fpistm Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIM7 does not exist and prevent build. How did you test the check variant example?

Suggested change
#define TIMER_SERVO TIM7
#define TIMER_SERVO TIM16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Variant] NUCLEO-L412RB-P Add board NUCLEO L412RB-P
2 participants