-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards/nucleo-l452: initial support #8441
Conversation
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.
Now that #8065 is merged this PR needs to be adapted. See how this is done with other nucleo boards.
I didn't go into the vectors.c details, I'll do that later.
boards/nucleo-l452/board.c
Outdated
@@ -0,0 +1,34 @@ | |||
/* |
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.
with #8065, this is file is no longer needed
cpu/stm32l4/vectors.c
Outdated
@@ -172,32 +170,37 @@ ISR_VECTOR(1) const isr_t vector_cpu[CPU_IRQ_NUMOF] = { | |||
[TIM1_TRG_COM_IRQn ] = isr_tim1_trg_com, /* [26] TIM1 Trigger and Commutation Interrupt */ | |||
[USB_IRQn ] = isr_usb, /* [67] USB event Interrupt */ | |||
[CRS_IRQn ] = isr_crs, /* [82] CRS global interrupt */ | |||
#elif defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) | |||
#elif defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) || defined(CPU_MODEL_STM32L452RE) |
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.
This line could be split using \
cpu/stm32l4/vectors.c
Outdated
[DFSDM1_FLT2_IRQn ] = isr_dfsdm1_flt2, /* [63] DFSDM1 Filter 2 global Interrupt */ | ||
[OTG_FS_IRQn ] = isr_otg_fs, /* [67] USB OTG FS global Interrupt */ | ||
[SAI2_IRQn ] = isr_sai2, /* [75] Serial Audio Interface 2 global interrupt */ | ||
#endif | ||
#if defined(CPU_MODEL_STM32L432KC) || defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) |
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.
This line could be split using \
7ae251f
to
c12119b
Compare
@aabadie addressed comments. |
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.
Found another style issue in vectors.c
. I need to have a look at the datasheet, just to be sure.
cpu/stm32l4/vectors.c
Outdated
[DFSDM1_FLT2_IRQn ] = isr_dfsdm1_flt2, /* [63] DFSDM1 Filter 2 global Interrupt */ | ||
[OTG_FS_IRQn ] = isr_otg_fs, /* [67] USB OTG FS global Interrupt */ | ||
[SAI2_IRQn ] = isr_sai2, /* [75] Serial Audio Interface 2 global interrupt */ | ||
#endif | ||
#if defined(CPU_MODEL_STM32L432KC) || defined(CPU_MODEL_STM32L476RG) || \ | ||
defined(CPU_MODEL_STM32L475VG) | ||
[TIM7_IRQn ] = isr_tim7, /* [55] TIM7 global interrupt */ |
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.
The indendation is off here
@aabadie about those vector files, I only added the ones I used in the functions implemented, what are the other stuff I should look for? I also excluded the ones that are not used for this specific board. Should I generalize for more cpu familiy's? |
@aabadie ping |
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 think it would also be great to configure the RTT for this board. See my comment below.
boards/nucleo-l452/Makefile.features
Outdated
# Put defined MCU peripherals here (in alphabetical order) | ||
FEATURES_PROVIDED += periph_gpio | ||
FEATURES_PROVIDED += periph_pwm | ||
FEATURES_PROVIDED += periph_rtc |
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 think you could also add a RTT on this board, see the nucleo-l476 as an example.
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 don't think RTT works for L4, at least running tests/periph_rtt doesn't work on L476, doesn't work in master an doesn't work at least up to release 2017.07. I'm trying to look in to this, but it got broken along the way another stm32lx broken feature.... Considering this I would rather not implement this right now, merge the board and then add RTT in the future, what do you think @aabadie ?
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.
rtt added
e5b7dc0
to
96a0e06
Compare
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.
Just gave it a try with b-l475e-iot01a board:
- examples/default: works
- tests/periph_timer: crashes
I think the changes in vectors.c are invalid. See my comment below.
cpu/stm32l4/vectors.c
Outdated
[UART4_IRQn ] = isr_uart4, /* [52] UART4 global Interrupt */ | ||
[DFSDM1_FLT0_IRQn ] = isr_dfsdm1_flt0, /* [61] DFSDM1 Filter 0 global Interrupt */ | ||
[DFSDM1_FLT1_IRQn ] = isr_dfsdm1_flt1, /* [62] DFSDM1 Filter 1 global Interrupt */ | ||
#elif defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) |
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.
Not sure this elif is valid. It breaks the tests/periph_timer
application with the b-l475e-iot01a board (uses a STM32L475VG).
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.
@aabadie addressed issue, you are right the elif wasn't valid, changed all to just ifdef
cpu/stm32l4/vectors.c
Outdated
#elif defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) | ||
#endif | ||
#if defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) || \ | ||
defined(CPU_MODEL_STM32L452RE) |
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.
please align to the defined on previous line (like you did below)
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.
@fjmolinas, can you address my comment here (that is also valid for line 176 below) ? After that, I think it can be merged
cpu/stm32l4/vectors.c
Outdated
#elif defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) | ||
#endif | ||
#if defined(CPU_MODEL_STM32L476RG) || defined(CPU_MODEL_STM32L475VG) || \ | ||
defined(CPU_MODEL_STM32L452RE) | ||
[ADC1_2_IRQn ] = isr_adc1_2, /* [18] ADC1, ADC2 SAR global Interrupts */ |
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.
This enum doesn't exist in l452 cmsis file, it's called ADC1_IRQn, like for the l432.
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.
@aabadie there an alias for l452 defined in the cmsis files at line 16034, would you rather have me use the original one?
/* Aliases for __IRQn */
#define ADC1_2_IRQn ADC1_IRQn
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.
there an alias defined in the cmsis files at line 16034
Sorry, I didn't scroll that far ;)
would you rather have me use the original one?
I would say yes, we never know. It may simplify an update of that file if one day there's a new version from ST.
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 think I got confused jajajaja, should or should I not use the alias. (I wasn't very clear what I meant by original one jajajaja)
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.
Do you mean the alias was already there (ST code) or you added it for convenience ? If it's the latter, I would avoid this, otherwise, keep it like this.
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.
It was included in the original cmsis file, with this header
//
/ For a painless codes migration between the STM32L4xx device product /
/ lines, the aliases defined below are put in place to overcome the /
/ differences in the interrupt handlers and IRQn definitions. /
/ No need to update developed interrupt code when moving across /
/ product lines within the same STM32L4 Family /
//
So I think it's going to stay in future files too ;) .
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.
Agreed
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.
Found remaining problems with the vectors.
@aabadie addressed coments. |
#ifndef CLOCK_LSE | ||
/* 0: no external low speed crystal available, | ||
* 1: external crystal available (always 32.768kHz) | ||
* This defaults to 0 because hardware revision 'MB1136 C-01' of the nucleo-64 |
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.
Looks like this line is a copy paste from the l476, I don't think it is valid for l452re. Maybe simply remove it ?
@aabadie removed copy pasta. |
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.
No other comments on my side, the changes look good now.
Untested-ACK
Please squash the commits in 2:
Ah, I almost forget about it, would you mind renaming the board to |
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.
Found a remaining doxygen issue.
*/ | ||
|
||
/** | ||
* @ingroup boards_nucleo-l452re |
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.
There's a problem here (just noticed that sorry): this doxygen group is never defined. Have a look here for an example.
After this is fixed, we are good.
@aabadie I think that would be it, can you confirm the doxygen group thing is ok?, haven't really looked at how that works (will now jaja) |
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.
Looks really good now ! ACK
Just triggered Murdock: I see problems coming with unittest |
no problems :) |
No, it passed ! So let's go @fjmolinas. Well done and thanks for your patience :) |
Contribution description
Add initial support for nucleo-l452, tested on nucleo-l452re.
Issues/PRs references