Skip to content

boards: add nucleo-f042#6273

Merged
PeterKietzmann merged 2 commits intoRIOT-OS:masterfrom
OTAkeys:pr/nucleo-f042
Jan 10, 2017
Merged

boards: add nucleo-f042#6273
PeterKietzmann merged 2 commits intoRIOT-OS:masterfrom
OTAkeys:pr/nucleo-f042

Conversation

@vincent-d
Copy link
Copy Markdown
Member

@vincent-d vincent-d commented Dec 28, 2016

This PR adds the support for the tiny nucleo-f042 board. This board is based on a stm32f042k6 MCU.

I have succesfully ran hello_world, ipc_pingpong and default examples.

@aabadie aabadie added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Dec 28, 2016
Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Tested on board, works well. Well done 👍

* oscillator provided on the X2 slot.
* See Nucleo User Manual UM1724 section 5.6.2.
*/
//#define RTC_NUMOF (1U)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

RTC is supported on STM32f0 CPUs, so why commenting this out ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

RTC is indeed supported, but there is no LSE on this board. I should change the define to 0, btw.

The other option is to add the capability of running with the LSI to the RTC driver, but this require more work ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes sense. I'm fine with the define to 0 then.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 5, 2017

It would be great if you could add a wiki page here describing this board.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 5, 2017

I ran a few tests (mainly the xtimer ones) and had some ram overflows at linkage. This CPU has only 6k of ram so you'll have to add it in the BOARD_INSUFFICIENT_MEMORY variable in a few Makefiles.
Let's ask Murdock about that.

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 5, 2017
@vincent-d
Copy link
Copy Markdown
Member Author

@aabadie I am wondering if we could reduce the default thread stack size for this board. I ran some tests with the line export CFLAGS=-DTHREAD_STACKSIZE_DEFAULT=512 in the board's Makefile.include and it run fine. Otherwise some tests just do not link or crash early when printing.

I'm not sure if it should be set on the board level or application level though.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 6, 2017

@aabadie I am wondering if we could reduce the default thread stack size for this board. I ran some tests with the line export CFLAGS=-DTHREAD_STACKSIZE_DEFAULT=512 in the board's Makefile.include and it run fine.

Sounds reasonable. Maybe @OlegHahm, @kaspar030 have a better opinion on that.

@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Jan 6, 2017

I think the best place could be here just next to the header include.

@vincent-d
Copy link
Copy Markdown
Member Author

board added to BAORD_INSUFFICIENT_MEMORY in tests which do not compile. Default stack size reduced in the way suggested by @kYc0o

Rebased on latest master.

@aabadie aabadie added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Jan 6, 2017
Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

ACK when Murdock is happy, commits are squashed and the tests/conn_can/mapping_read.py python file is removed

@@ -0,0 +1,35 @@
import re
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like you added this file by mistake (git add tests ?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oops, indeed git add tests :D

@vincent-d
Copy link
Copy Markdown
Member Author

fixed and squashed

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jan 6, 2017

@aabadie I am wondering if we could reduce the default thread stack size for this board. I ran some tests with the line export CFLAGS=-DTHREAD_STACKSIZE_DEFAULT=512 in the board's Makefile.include and it run fine. Otherwise some tests just do not link or crash early when printing.

Why do you think that this stack size would be sufficient for this MCU but not for other MCUs from the same family?

edited

@vincent-d
Copy link
Copy Markdown
Member Author

Well, I guess it depends on your application.

The stack size seems enough for basic application, but for bigger ones it could be an isssue. Anyway the RAM is small on this micro, so you will not be able to run a lot of threads, especially if you use some more memory for data. Moreover printf needs some free RAM used as heap.

I don't mind reverting back that change and letting the default stack size to 1024.

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jan 6, 2017

I agree with your assessments, but I would leave it to the application developer to choose the optimized stack size values. The default values per MCU (family) are intended to be on the safe side for most standard cases.

@vincent-d
Copy link
Copy Markdown
Member Author

I'm fine with that.

Stack size change removed, and squashed.

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jan 6, 2017

In this case, immediate squashing is no issue, but usually you should not squash before a reviewer has approved the amendment (just in case you didn't know).

@OlegHahm OlegHahm removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Jan 6, 2017
Copy link
Copy Markdown
Member

@OlegHahm OlegHahm left a comment

Choose a reason for hiding this comment

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

@aabadie already approved this PR

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 6, 2017

@vincent-d, there are remaining issues reported by Murdock.

@vincent-d
Copy link
Copy Markdown
Member Author

#6187 has been merged in between.

I will update that PR with the new uart driver.

@haukepetersen
Copy link
Copy Markdown
Contributor

cool, thanks!

@vincent-d
Copy link
Copy Markdown
Member Author

Do we care about the whitespace check fail in the vendor header ?

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Jan 9, 2017

If it's just failing because of trailing white spaces it should be super simple to fix, right?

@vincent-d
Copy link
Copy Markdown
Member Author

Murdock still complains about some unrelated errors (lwip download failed ?) but it looks OK now.

Shall I squash ?

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 9, 2017

can you:

git commit --amend
git push -f

?

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 9, 2017

This will force a Murdock restart

@vincent-d
Copy link
Copy Markdown
Member Author

Murdock seems happy.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 10, 2017

@vincent-d, Murdock is complaining because this branch needs squashing. Can you create 2 separate commits with comments:

  • cpu/stm32f0: add support for stm32f042x6 mcu
  • boards/nucleo-f042: initial support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants