boards/cpu: add support for nucleo144-f746 and stm32f7#6907
boards/cpu: add support for nucleo144-f746 and stm32f7#6907aabadie merged 4 commits intoRIOT-OS:masterfrom
Conversation
|
Did you switch the solder jumper configuration?
|
cpu/stm32f7/ldscripts/stm32f746zg.ld
Outdated
| { | ||
| rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K | ||
| ram (rwx) : ORIGIN = 0x20000000, LENGTH = 320K | ||
| cpuid (r) : ORIGIN = 0x1ff80050, LENGTH = 12 |
There was a problem hiding this comment.
this should be 0x1ff0f420 see datasheet section 41.1 page 1654
cpu/stm32f7/include/cpu_conf.h
Outdated
| } | ||
| #endif | ||
|
|
||
| #endif /* STM32L4_CPU_CONF_H */ |
cpu/stm32f7/vectors.c
Outdated
| ISR_VECTORS const void *interrupt_vector[] = { | ||
| /* Exception stack pointer */ | ||
| (void*) (&_estack), /* pointer to the top of the stack */ | ||
| /* Cortex-M4 handlers */ |
|
I allowed myself to push a couple of commits that fix a few problems (cpuid + common nucleo-144 board include). But still no UART or GPIO. |
|
@aabadie: thanks for the fixes! Just out of curiosity: were you able to push directly into my branch without having write access? Interesting :-) @DipSwitch: nope, did not touch the default hardware configuration, must I? |
This is one of the GitHub's features. When one creates a PR, there's a checkbox for allowing maintainers of a project to push someone else's branch. |
|
Ahh, I see, very interesting, good to know (and quite useful!) :-) |
|
Yes but this is something that we should not abuse, especially with new contributors (even though this is debatable). Otherwise I think it is useful when we want to speed things up by just fixing remaining nits or squashing just before merging. But this is not a very interesting job. |
|
I have that board: http://www.st.com/en/evaluation-tools/32f746gdiscovery.html I found an issue with |
d4c2080 to
631559f
Compare
|
Alright, after some more hours of debugging I got it to work! Should run fine now. There were actually a couple of issues: wrong flash wait cycle computation, PLL was not set as system clock, HSE was not properly enabled... But all fixed now. |
|
Can anyone explain to me, where the And anyway, how do we get around this false positive? |
|
Add a suppression comment /* cppcheck-suppress variableScope
* variable used in assembly-code below */ |
|
(above the line pointed out by cppcheck). Regarding the supposed fixing: did anyone test locally with the version of cppcheck running on Murdock? |
Good job ! I'll test asap |
aabadie
left a comment
There was a problem hiding this comment.
Some nits and configuration improvements still needed. Otherwise, good job. All STM32 mcu are now supported and full Nucleo support is almost done !
| FEATURES_PROVIDED += periph_uart | ||
|
|
||
| # load the common Makefile.features for Nucleo boards | ||
| include $(RIOTBOARD)/nucleo-common/Makefile.features |
There was a problem hiding this comment.
should be nucleo144-common
cpu/stm32f7/include/periph_cpu.h
Outdated
|
|
||
| #ifndef DOXYGEN | ||
| /** | ||
| * @brief Override ADC resolution values |
There was a problem hiding this comment.
@name
btw, I'm wondering if those ADC definitions are required since this MCU doesn't provide the implementations for ADC ?
There was a problem hiding this comment.
No, brief is right, but the braces are not required here (since doxygen parses the enum as one type anyway)
There was a problem hiding this comment.
Then again, doesn't #ifndef DOXYGEN imply that this is NOT parsed by doxygen. In this case @brief still makes more sense, since this is a brief description, not a name.
There was a problem hiding this comment.
removed them for now.
cpu/stm32f7/vectors.c
Outdated
| */ | ||
|
|
||
| /** | ||
| * @ingroup cpu_stm32l4 |
cpu/stm32f7/vectors.c
Outdated
| WEAK_DEFAULT void isr_svc(void); | ||
| WEAK_DEFAULT void isr_pendsv(void); | ||
| WEAK_DEFAULT void isr_systick(void); | ||
| /* STM32L4 specific interrupt vectors */ |
cpu/stm32f7/vectors.c
Outdated
| (void*) isr_fpu | ||
| }; | ||
|
|
||
| #if 0 |
There was a problem hiding this comment.
I guess this block can be removed
| { | ||
| .dev = USART2, | ||
| .rcc_mask = RCC_APB1ENR_USART2EN, | ||
| .rx_pin = GPIO_PIN(PORT_A, 3), |
There was a problem hiding this comment.
I would prefer to use PG9 and PG14 for this UART. Then it corresponds to the Arduino RX/TX pins. See what's done the the other nucleo144 boards.
There was a problem hiding this comment.
changed pins to PD5 and PD6
| { | ||
| .dev = USART1, | ||
| .rcc_mask = RCC_APB2ENR_USART1EN, | ||
| .rx_pin = GPIO_PIN(PORT_B, 7), |
There was a problem hiding this comment.
Same here there's a USART text printed next to CN8, I would prefer to use one the USART pins available there (probably PD6,PD5)
There was a problem hiding this comment.
cant find any more useful mapping these pins...
| FEATURES_PROVIDED += periph_cpuid | ||
| FEATURES_PROVIDED += periph_gpio | ||
| FEATURES_PROVIDED += periph_hwrng | ||
| FEATURES_PROVIDED += periph_timer |
There was a problem hiding this comment.
For completeness, we could add some PWM configuration. Maybe it's better to add it in a follow-up PR ?
There was a problem hiding this comment.
I would prefer doing it in a follow-up
|
I also noticed the rework of clock initialization that I think is a nice addition. Do you think it could be generalized to all STM32 ? |
|
Tested on board: no UART. Is there any special change required on the board or can I use the default configuration ? |
cpu/stm32_common/cpu_common.c
Outdated
| break; | ||
| #elif defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F4) \ | ||
| || defined(CPU_FAM_STM32L4) | ||
| || defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F7) |
There was a problem hiding this comment.
Should be added in periph_clk_dis as well
Yes, thats the point of it. But lets go in small steps, the next one being in #6970 |
Nope, didn't touch any (HW) configuration on the board. Mine works as is with this branch. |
d3e24a8 to
144409c
Compare
|
good catch -> seems there was a reason I had that block of out-commented interrupt vectors still in the the vectors file earlier... Fixed. Also explicitly tested UART_DEV(1) and confirmed it working: |
|
Had a look at the changes again. They all looks good to me now so it's time for squashing here. What's the version of your compiler ? (I have gcc 4.9.3) Maybe I can try another one to see if it makes a difference. |
|
144409c to
b8dc85f
Compare
|
squashed |
|
@vincent-d: are all your change requests fulfilled? |
vincent-d
left a comment
There was a problem hiding this comment.
Found another issue, sorry.
cpu/stm32f7/vectors.c
Outdated
| (void*) isr_rtc_wkup, | ||
| (void*) isr_flash, | ||
| (void*) isr_rcc, | ||
| (void*) isr_exti0, |
There was a problem hiding this comment.
It seems like every other stm32 define every isr_exti* as isr_exti, gpio interrupt are crashing otherwise.
There was a problem hiding this comment.
Yes, that's correct. This change was lost when I copied in the correct isr table...
b8dc85f to
17fedc7
Compare
|
fixed |
|
@aabadie: what is your verdict, are you ready to approve as well? |
I re-tested yesterday by flashing an mbed generated firmware that should print something on UART: didn't work. So there's probably something broken on the board I have. |
|
Re-triggered a build on Murdock2 |
|
All green: Go! |
|
Hi, For the BOARD=nucleo144-f767, the support for the I2C and SPI is not yet defined in there. Is there any plan for this update? Thank you. |
|
We just need to find someone doing this, so feel free to port them :-) |
Almost there, but no UART output. Seems like I missed something, but can't see it right now. @aabadie: feel free to take over this PR - or wait until I am back from holiday...