board/nucleo-l412kb#12144
Conversation
The last OpenOCD release is from January 2017 and lacks support for many new chips. Did you try building the latest OpenOCD directly from git master? |
|
From your OpenOCD log: |
|
Thanks for the hints! I ran I've then investigated the open-ocd source and digged into case 0x464:
max_flash_size_in_kb = 128;
break;Then I basically compiled the code manually using: # ./bootstrap nosubmodule
# ./configure --prefix=/usr/local/Cellar/open-ocd/HEAD-0819541 --enable-buspirate --enable-stlink --enable-dummy --enable-jtag_vpi --enable-remote-bitbang
# make install(I used the same prefix as brew did since I have hopes for the open-ocd project to include these changes at some point, which would then overwrite my hack as a brew bottled installation) Using this updated version I could finally flash the code and test the hello-world example: So I guess this PR could be tested and merged, if anyone feels like going through this procedure. 🤷♂ And no, I haven't opened an issue on open-ocd about this, because, SourceForge. |
|
Nice! But hey, they even have a nice guide: http://openocd.org/doc-release/doxygen/patchguide.html |
|
@benpicco initially I just wanted to replace the lightbulb in the kitchen, you know? |
|
I think someone already tries to add support to this cpu to OpenOCD: http://openocd.zylin.com/#/c/4934/ Regarding stlink version config file in OpenOCD, it's just a warning and it should still work with the old version. Enabling the generic stlink config will break flash when one uses OpenOCD 0.10 which is the latest release. So I won't include this change in this PR. |
|
@aabadie thought about checking for the |
|
This is looking good, but one nit: Please split this into a commit to add support for the cpu ( |
|
@benpicco might wanna check again? Not sure if it's implemented in the best way possible now, but the board seems to work good so far. |
|
Murdock is not happy. You could either remove advertising support for the features that are not implemented yet for this board/CPU - or you could go about implementing them. 😉 |
|
Murdock is complaining because the tests do not fit in ROM, please blacklist the board from those tests by adding it to It would be useful if you could run all tests for the board by doing, so we can see it is working properly even though we do not have the board to test.
If possible please post the results of this, it should take between 30min~1hr depending on your cpu. |
fjmolinas
left a comment
There was a problem hiding this comment.
I have just one minor comment in code.
| #endif | ||
|
|
||
| #if defined(CPU_MODEL_STM32L412KB) | ||
| #define RTC_ISR_ALRAF RTC_SR_ALRAF |
There was a problem hiding this comment.
Although I prefer this indentation, it is not the way it is done for the rest of the code, so please change this to:
#if defined(CPU_MODEL_STM32L412KB)
#define RTC_ISR_ALRAF RTC_SR_ALRAF
#endif
There was a problem hiding this comment.
I think
#ifndef RTC_ISR_ALRAF
#define RTC_ISR_ALRAF RTC_SR_ALRAF
#endif would be a more generic solution.
| return -1; | ||
| } | ||
|
|
||
| #if defined(CPU_MODEL_STM32L412KB) |
There was a problem hiding this comment.
When in Rome, do as the Roman's do.
I don't like editing vendor files, but having this be the only member of that family that didn't edit that part of the vendor files makes it odd too.
I don't see a generic way to detect this either, so let's just follow the precedent and also edit stm32l412xx.h to change CCR1…4 -> CCR[4].
Then the changes to common files should be minimal and this will be good to merge.
There was a problem hiding this comment.
I agree with you @benpicco. It's not nice to edit CMSIS files but since this is done like this for others...
|
You don't have to update all the |
|
You can just run Then you just have to address some small comments and this should be good 😉 |
|
@benpicco thank you for the feedback, really appreciate your effort! :-) Sorry for the long delay, unfortunately I currently have a few other topics on my hands, but lightbulb-changing should soon be back to normal so that I can finally finish this PR. :-) Simply haven't had time so far. |
| return -1; | ||
| } | ||
|
|
||
| #if defined(CPU_MODEL_STM32L412KB) |
There was a problem hiding this comment.
I agree with you @benpicco. It's not nice to edit CMSIS files but since this is done like this for others...
|
I tested this PR and could make it work after some changes. But I had some problems:
@mrusme, I made some changes locally but I can't PR or push to your branch. Are you ok if I take over this PR ? I hope we'll be able to get it merged sooner. |
|
@aabadie sorry, go ahead! |




Contribution description
Implemented Nucleo L412KB support. The code is compiling, but it's untested yet as I have to figure out how to get past an open-ocd issue that I'm experiencing:
Issues/PRs references
#12139