-
Notifications
You must be signed in to change notification settings - Fork 3k
NUCLEO_L496ZG: Add new Platform #4650
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
Conversation
@theotherjimmy Yes for sure, we noticed the incoming changes. Description updated. |
@theotherjimmy done |
Excellent. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one misaligned line
tools/build_travis.py
Outdated
@@ -63,6 +63,7 @@ | |||
{ "target": "NUCLEO_F446ZE", "toolchains": "GCC_ARM", "libs": ["dsp", "usb"] }, | |||
{ "target": "NUCLEO_F746ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "usb"] }, | |||
{ "target": "NUCLEO_F767ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "usb"] }, | |||
{ "target": "NUCLEO_L496ZG", "toolchains": "GCC_ARM", "libs": ["dsp"] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you align this line ?
Hi |
|
||
const PinMap PinMap_ADC[] = { | ||
{PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 | ||
// {PA_0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of commenting those lines, we use now this convention: "PA_0_ALT0". With PA_0_ALT0 defined in PinNames.h. You can have a look for example in the DISCO_L475VG_IOT01A target.
|
||
const PinMap PinMap_I2C_SDA[] = { | ||
{PB_4, I2C_3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, | ||
// {PB_7, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // (pin used by LED2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have also decided recently to enable all pins even those connected to other board's components. This way anobody who has created his own board with the same device will be able to use this target. We use also this convention "// Connected to LED2".
}; | ||
|
||
//*** PWM *** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this comment: "// Warning: Pins using PWM_5 cannot be used as TIMER5 is already used by the us_ticker."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that now we enable all pins and use the convention "PA_0_ATL0" for example to let users access to all pins on custom boards. But should I also uncomment the pins using PWM_5 ? I guess no as user shouldn't use them while TIMER5 is used by the ticker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right. The pins using PWM_5 must remain commented.
{PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 | ||
// {PA_0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 | ||
{PA_1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 1)}, // TIM15_CH1N | ||
// {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use PA_1_ALT0 and same for all commented pins
{PD_2, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, | ||
{PD_6, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, | ||
{PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, | ||
{PG_8, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "// Connected to STDIO_UART_RX"
{PC_12, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, | ||
{PD_5, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, | ||
{PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // ARDUINO D1 | ||
{PG_7, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "// Connected to STDIO_UART_TX"
@@ -0,0 +1,96 @@ | |||
/* mbed Microcontroller Library | |||
******************************************************************************* | |||
* Copyright (c) 2015, STMicroelectronics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
|
||
#include "PeripheralPins.h" | ||
|
||
// ===== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this note instead:
//==============================================================================
// 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.
//
//==============================================================================
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add:
typedef enum {
ALT0 = 0x100,
ALT1 = 0x200,
ALT2 = 0x300,
ALT3 = 0x400
} ALTx;
#endif | ||
|
||
typedef enum { | ||
PA_0 = 0x00, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add:
PA_0_ALT0 = PA_0|ALT0,
whenever it is necessary. We put only used pins not all of them.
/*-Memory Regions-*/ | ||
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; | ||
define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; | ||
define symbol __ICFEDIT_region_ROM_TARA_start__ = 0x08080000; /* TARA Lite Demo */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed. Is it from previous project ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review !
I get this file on STM32Cube as indicated here ST porting guide but it seems that I took it from a project example. I will replace it with the template provided by STM32Cube.
@bcostm The 4 new commits should resolve what you pointed in your review 😉 |
Thanks for your contribution. |
@0xc0170 By test you mean the results of
We also try with success the blinky example and some 6LoWPAN program using the ATMEL Firefly 6LoWPAN shield. |
what are those timeouts ? HAve you resolved them? |
@0xc0170 It seems that it is an issue specific to Linux (we are using Ubuntu 16.04). Sometimes we have a lots of timeout, sometimes not. I just ran the tests on windows and 100% of the test were OK. |
Hi |
/morph uvisor-test |
Test : SUCCESSBuild number : 113 |
/morph uvisor-test |
/morph export-build |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 168 Exporter Build failed! |
@pmancele The one and only one failure, NUCLEO_L496ZG for uvision does not build, can you please retest blinky example, should be able to reproduce the failure |
I ran |
@bcostm thanks for testing. I run it also locally, no errors for me, blinky, uvision5. /morph export-build |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 169 Exporter Build failed! |
@theotherjimmy Could this be a tool issue ? |
Maybe. It looks like spaces in an assembly path did not get escaped correctly |
sigh it's in common code. If that's the case why did this board fail, and no others. |
Exporter Build : FAILUREBuild number : 37 |
On the latest exporter build I can't actually see what the failure was! Re-running |
From the logs looks like Segmentation fault
|
Exporter Build : ABORTEDBuild number : 40 |
Re-triggering the exporter build as make_iar segmentation fault is fixed |
Exporter Build : SUCCESSBuild number : 59 |
@studavekar I did not report status back (the last exporter build) |
Fixed now, all green, ready for merge 🎆 |
Description
Add support for the NUCLEO_L496ZG and the STM32L496xG MCUs.
All the toolchains (ARM_MICRO/ARM_STD/IAR/GCC_ARM) have been added but only the GCC_ARM one has been tested on our side.
This PR should resolve #4606.
Status
Ready
This is our first port so feel free to point anything we should change.
Regards