Skip to content

Variant addition: Nucleo-64 L412RB_P #2713

New issue

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

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

Already on GitHub? # to your account

Merged
merged 8 commits into from
Apr 22, 2025
Merged

Conversation

askuric
Copy link
Contributor

@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.

This was linked to issues Apr 17, 2025
askuric and others added 4 commits April 22, 2025 09:10
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Antun Skuric <36178713+askuric@users.noreply.github.com>
@askuric
Copy link
Contributor Author

askuric commented Apr 22, 2025

Hi @fpistm,

Thanks for the comments.
I've just realised that when I apply the changes you suggested the comments disappear as well.

The changes that I've done:

  • Updated readme to remove the change of the unrealted board
  • Updated the boards.txt to remove the end of file change (missing empty line at the end)

Accepted the changes

  • memory ld file: I've used the stock file generated by CubeMX, I did not necessary have a use for the RAM2, that's how CubeMX generated the file. So if you want me to remove it let me know. :D
  • TIM7 used but not defined: I've used the nucleo_l433rc_p files as a template for this l412rb_p as they belong to the same family of nucleos-64. As I ran the examples and I did not see any errors I did not catch this issue and the TIM7 stayed.

How did you test the variant?
I've tested it using Arduino IDE, I've changed the files in the arduino board packages and used the checkvariant example link (I've copied it in the arduino sketch and run it on the nucleo board).
Also, I've used SimpleFOC and run a code turning a motor on the nucleo and measuring the currents. Which worked well.

Is there a better way of testing. I'm planning to add two more nucleo-64 variants in the next few days so if you have some suggestions, please let me know :D

@fpistm
Copy link
Member

fpistm commented Apr 22, 2025

Is there a better way of testing. I'm planning to add two more nucleo-64 variants in the next few days so if you have some suggestions, please let me know :D

No it is a good way to test the variant and its definitnion. As said, it is really strange you didn't see the build issue, maybe an issue in the selected target.

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.

LGTM

@askuric
Copy link
Contributor Author

askuric commented Apr 22, 2025

Ok that's interesting. Now I'm having some issues with the build with the latest changes.
When I build and upload the code to the board I get the FAIL.txt file which says:

The application file format is unknown and cannot be parsed and/or processed

I think that my lack of experience is catching up with my initial luck. :D
Let me do some more testing and come back to you.

@fpistm
Copy link
Member

fpistm commented Apr 22, 2025

The application file format is unknown and cannot be parsed and/or processed

Try to update the STLink firmware using the STM32Cube programmer thanks the "Firmware upgrade" button.

@askuric
Copy link
Contributor Author

askuric commented Apr 22, 2025

Try to update the STLink firmware using the STM32Cube programmer thanks the "Firmware upgrade" button.

I've tried this and it did not make any difference.
But what did make a difference is to put the Upload method to STM32CubeProgrammer (SWD) and not Mass storage. :D
With the SWD I have no more issues and everything works well.

Is this a red flag or is it normal?

Additionally, I've run some more tests, so far I've tested:

  • Timers
  • ADC
  • SPI
  • Pin names (as I'm using Arduino UNO R3 header names)

And everything seems to work as expected.

@fpistm
Copy link
Member

fpistm commented Apr 22, 2025

If swd works it is linked to the Stlink firmware which provides the mass storage storage.
No link with the binary

@askuric
Copy link
Contributor Author

askuric commented Apr 22, 2025

So then it's an issue with my setup, not the variant files right?
So the PR is ok?

@fpistm
Copy link
Member

fpistm commented Apr 22, 2025

Unfortunately, I do not have this board to test anyway from my point of view the PR is ok.

@fpistm fpistm added the new variant Add support of new bard label Apr 22, 2025
@fpistm fpistm added this to the 2.11.0 milestone Apr 22, 2025
@fpistm fpistm mentioned this pull request Apr 22, 2025
84 tasks
@fpistm fpistm merged commit fddfdeb into stm32duino:main Apr 22, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in STM32 core based on ST HAL Apr 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
new variant Add support of new bard
Projects
Development

Successfully merging this pull request may close these issues.

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