Skip to content

New support for the STM NUCLEO_L433RC-P board #5230

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

Closed
wants to merge 717 commits into from

Conversation

helmut64
Copy link
Contributor

@helmut64 helmut64 commented Oct 1, 2017

Dear ST and MBED team,
I added support for a new the target NUCLEO_L433RC.
The L433 is pretty much like the L432, but STDIO pins and peripherals are different.
I tested this using the official NUCLEO_L433RC board from STM.
I have not done the job for export_test.py and tests.py as documented in “steps-to-create-a-new-STM32-platform” because the documentation does not match file files.
Regards Helmut

@bcostm
Copy link
Contributor

bcostm commented Oct 2, 2017

Thanks a lot ! We'll review the code and run mbed2 and mbed5 tests for all toolchains.

PB_14 = 0x1E,
PB_15 = 0x1F,

#ifndef STM32L433_48PINS // 48 pin versions don't have PC0-PC15 pins
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this define set ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The define STM32L433_48PINS can be set by users to limited to pins to the 48 pin versions of the STM433 MCUs, by default this is included because the Nucleo board uses the 64 pin version.
The define STM32L433_100PINS can be set by users to extend the pins to the 100 pin versions of the STM433 MCUs.

The is reasonable to be more flexible for the pin definition which allows many more 433 MCUs to be used.

The __weak of PinMaps in the PeripheralPins.c allows to extend this for other MCUs, another option would be to use the PeripheralPins.c for the 100 pin MCU version which is a superset of the 64 pin version.

Copy link
Contributor

@bcostm bcostm Oct 2, 2017

Choose a reason for hiding this comment

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

OK. The __weak is a good idea and we prefer this solution.


//*** PWM ***
// TODO: Timers/PWM for the L433xx need to be reviewed/completed,
// Check for TIM6/TIM7 of the 433
Copy link
Contributor

@bcostm bcostm Oct 2, 2017

Choose a reason for hiding this comment

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

I don't see any PWM pins on TIM6/TIM7 in the DataSheet.

Can you add the "_ALTx" on the pins that we don't use ? You will need also to add the _ALTx definitions in the PinNames.h file (see NUCLEO_F429ZI for example).

//*** SERIAL ***

__weak const PinMap PinMap_UART_TX[] = {
// {PA_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
Copy link
Contributor

@bcostm bcostm Oct 2, 2017

Choose a reason for hiding this comment

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

Can you add a comment:
// Cannot be used as UART2 is used for STDIO

};

__weak const PinMap PinMap_UART_RX[] = {
// {PA_3, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
Copy link
Contributor

@bcostm bcostm Oct 2, 2017

Choose a reason for hiding this comment

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

Can you add a comment:
// Cannot be used as UART2 is used for STDIO

{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
{PA_15, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?


__weak const PinMap PinMap_UART_CTS[] = {
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

{PA_6, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
{PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
{PB_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

{PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PA_12, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PB_5, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

__weak const PinMap PinMap_SPI_SSEL[] = {
{PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PA_4, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
{PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

__weak const PinMap PinMap_SPI_SCLK[] = {
{PA_1, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

__weak const PinMap PinMap_SPI_MISO[] = {
{PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PA_11, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
{PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the "_ALTx" on the pins that we don't use ?

* I declared all mapping tables as weak to allow custom overwrites for similar MCU models
* The busy GPIOs e.g. PA_3/3 are still declared to allow reusing them for other IO.
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please replace the 2 above notes with this one:

//==============================================================================
// Notes
//
// - The pins mentionned Px_y_ALTz are alternative possibilities which use other
//   HW peripheral instances. You can use them the same way as any other "normal"
//   pin (i.e. PwmOut pwm(PA_7_ALT0);). These pins are not displayed on the board
//   pinout image on mbed.org.
//
// - The pins which are connected to other components present on the board have
//   the comment "Connected to xxx". The pin function may not work properly in this
//   case. These pins may not be displayed on the board pinout image on mbed.org.
//   Please read the board reference manual and schematic for more information.
//
// - All mapping tables are declared as weak to allow custom overwrites for similar MCU models.
//
//==============================================================================

"macro_name": "CLOCK_SOURCE"
}
},
"detect_code": ["0770"],
Copy link
Contributor

Choose a reason for hiding this comment

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

I have the ID 0779 when I connect my NUCLEO-L433RC-P.

Can you confirm the ID you see in the MBED.HTM file (first 4 digits in the code field) ?

<meta http-equiv="refresh" content="0; url=http://mbed.org/device/?code=07790221172C637A2868F53E"/>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes my Code is: code=07790221172F6363286BF527

@bcostm
Copy link
Contributor

bcostm commented Oct 2, 2017

As the board is a NUCLEO_L433RC-P can you please change the name is this PR title and also in the files ?

@@ -1345,6 +1345,23 @@
"release_versions": ["2", "5"],
"device_name": "STM32L432KC"
},
"NUCLEO_L433RC": {
Copy link
Contributor

@bcostm bcostm Oct 2, 2017

Choose a reason for hiding this comment

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

Please change the name to NUCLEO_L433RC_P

@@ -54,6 +54,7 @@
{ "target": "NUCLEO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "usb"] },
{ "target": "NUCLEO_F412ZG", "toolchains": "GCC_ARM", "libs": ["dsp"] },
{ "target": "NUCLEO_L432KC", "toolchains": "GCC_ARM", "libs": ["dsp"] },
{ "target": "NUCLEO_L433RC", "toolchains": "GCC_ARM", "libs": ["dsp"] },
Copy link
Contributor

Choose a reason for hiding this comment

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

NUCLEO_L433RC_P

@@ -244,6 +244,11 @@ class Sw4STM32(GNUARMEclipse):
'name': 'NUCLEO-L432KC',
'mcuId': 'STM32L432KCUx'
},
'NUCLEO_L433RC':
Copy link
Contributor

Choose a reason for hiding this comment

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

NUCLEO_L433RC_P

@@ -244,6 +244,11 @@ class Sw4STM32(GNUARMEclipse):
'name': 'NUCLEO-L432KC',
'mcuId': 'STM32L432KCUx'
},
'NUCLEO_L433RC':
{
'name': 'NUCLEO-L433RC',
Copy link
Contributor

Choose a reason for hiding this comment

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

NUCLEO-L433RC-P

'NUCLEO_L433RC':
{
'name': 'NUCLEO-L433RC',
'mcuId': 'STM32L433RCUx'
Copy link
Contributor

Choose a reason for hiding this comment

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

STM32L433RCTxP

@helmut64 helmut64 changed the title New support for the STM NUCLEO_L433RC board New support for the STM NUCLEO_L433RC-P board Oct 2, 2017
@helmut64
Copy link
Contributor Author

helmut64 commented Oct 2, 2017

@bcostm I did all the changes you proposed, however no ALTx changes.
I don't get the ALTx concept, maybe you can explain it to me.
Thank you for reviewing the changes and getting this done together.

@ohagendorf
Copy link
Contributor

@helmut64 maybe my description in the introductory PR #3181 helps

@helmut64
Copy link
Contributor Author

helmut64 commented Oct 2, 2017

@ohagendorf Danke, now I understand, the PinMap table as an unique index for each pin therfore we use alternate names for multiple pin options. Working on it.


__weak const PinMap PinMap_UART_RX[] = {
// {PA_3, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
{PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment:
// Connected to STDIO_UART_RX

@bcostm
Copy link
Contributor

bcostm commented Oct 2, 2017

Thanks @helmut64
Concerning the pins PC_5 and PD_2, you have to remove them because they are not present on the NUCLEO_L433RC_P. Your original file version was correct. I thought you were working on the NUCLEO_L433RC (without the '-P'). Sorry about that.

@helmut64
Copy link
Contributor Author

helmut64 commented Oct 2, 2017

@bcostm I keep the PC_5, PD_2 because I use the STM433RCT for my projects. This is not hurting and helps me.
I added the _ALT mappings, this is a good solution.
All your feedback has been incorporated.

@helmut64
Copy link
Contributor Author

helmut64 commented Oct 3, 2017

@bcostm I reviewed the targets.json file for our new target, here are some questions:
a) "bootloader_supported": true
This is missing, it is included in the NUCLEO_L476RG/NUCLEO_L486RG targets, I don't see any reason not to enable it as well for the 433RC_P board. Any ideas?

b) SERIAL_ASYNCH
Again there is any reason this should be disabled, because the 433 uses the same serial as the other L4 MCUs. Maybe there is a difference in the DMA channels.

c) "release_versions": ["2", "5"],
Is this correct, I just copied it from the 432KC as a template.

Your advise will be appreciated.

overwrites for different MCU kinds.
added connected to STDIO_UART_XX comments
Comment out the STM32L433_100PINS defined because PD_2 is already
used in the PeripheralPins.c, otherwise it will not compile
Added SERIAL_ASYNCH into STM32L432KC target, it is now identical with
the STM32L433RC_P and other STM L4 targets.
MBED_APP_START/MBED_APP_SIZE variables
@helmut64
Copy link
Contributor Author

I did the rebase. I hope that this is now good.
I compiled the branch, it contains my changes.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2017

@helmut64 The branch shows here 250+ commits, it should contain only your changes.

@helmut64
Copy link
Contributor Author

@0xc0170 Hello Martin, than I will create a new branch, redo the changes and push it.
Will this be working for you?

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2017

@0xc0170 Hello Martin, than I will create a new branch, redo the changes and push it.
Will this be working for you?

Whatever works for you. It would be good to resolve it here via rebase but a new branch also work. This would be closed and new PR opened.

@helmut64
Copy link
Contributor Author

I created a new pull request #5591 branch NUCLEO_STM32L433_NEW

@0xc0170 0xc0170 closed this Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.