You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by "David G. Simmons" <sa...@mac.com> on 2016/06/03 17:07:35 UTC

Board Support Tutorial

Is there a tutorial, or some detailed docs on how to go about adding support for a new board? I’ve been trying to figure it out just going through the source tree, but I have to admit defeat.

For instance, there is apparently a script for connecting to the STM32F3Discovery board called stm32f3discovery.cfg that references:

# Script for connecting with the STM32F3DISCOVERY board
source [find interface/stlink-v2.cfg]
source [find target/stm32f3x_stlink.cfg]
reset_config srst_only srst_nogate

But I can’t even find those files in the tree anywhere.

And then there’s the whole BSP and HAL work to be done. I don’t imagine there’s much to do there, as the board has a Cortex-M0 on it, so that should be pretty straightforward, but how to enable all the external sensors, etc. that are on this board? It has BLE, touch sensors, IR, temp sensor, etc. I have a complete pinout for the MCU so I know what’s hooked to what pin, etc.

I’ve been looking through the STm32F3Discovery stuff and can’t even figure out how the pins from the MCU are mapped to pin values in mynewt (The MCU PE8 pin is an LED pin, and is somehow mapped to a pin in the 72-79 range. I’d love to know how to do this!)

Sorry for the naïve newby questions …

dg
--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.
* If you cannot read the PGP.sig attachment, please go to
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Re: Board Support Tutorial

Posted by "paul@wrada.com" <pa...@wrada.com>.
This is what I know about

http://mynewt.apache.org/os/core_os/porting/port_bsp/



From: "David G. Simmons" <sa...@mac.com>>
Reply-To: <de...@mynewt.incubator.apache.org>>
Date: Friday, June 3, 2016 at 10:07 AM
To: <de...@mynewt.incubator.apache.org>>
Subject: Board Support Tutorial


Is there a tutorial, or some detailed docs on how to go about adding support for a new board? I’ve been trying to figure it out just going through the source tree, but I have to admit defeat.

For instance, there is apparently a script for connecting to the STM32F3Discovery board called stm32f3discovery.cfg that references:

# Script for connecting with the STM32F3DISCOVERY board
source [find interface/stlink-v2.cfg]
source [find target/stm32f3x_stlink.cfg]
reset_config srst_only srst_nogate

But I can’t even find those files in the tree anywhere.

And then there’s the whole BSP and HAL work to be done. I don’t imagine there’s much to do there, as the board has a Cortex-M0 on it, so that should be pretty straightforward, but how to enable all the external sensors, etc. that are on this board? It has BLE, touch sensors, IR, temp sensor, etc. I have a complete pinout for the MCU so I know what’s hooked to what pin, etc.

I’ve been looking through the STm32F3Discovery stuff and can’t even figure out how the pins from the MCU are mapped to pin values in mynewt (The MCU PE8 pin is an LED pin, and is somehow mapped to a pin in the 72-79 range. I’d love to know how to do this!)

Sorry for the naïve newby questions …

dg
--
David G. Simmons
(919) 534-5099
Web<https://davidgs.com> • Blog<https://davidgs.com/davidgs_blog> • Linkedin<http://linkedin.com/in/davidgsimmons> • Twitter<http://twitter.com/TechEvangelist1> • GitHub<http://github.com/davidgs>
/** Message digitally signed for security and authenticity.
* If you cannot read the PGP.sig attachment, please go to
 * http://www.gnupg.com/ Secure your email!!!
 * Public key available at keyserver.pgp.com<http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.




Re: Board Support Tutorial

Posted by marko kiiskila <ma...@runtime.io>.
Hi David,

sorry for belated response, I’ve been off-grid for a bit now.

> On Jun 3, 2016, at 10:07 AM, David G. Simmons <sa...@mac.com> wrote:
> 
> 
> Is there a tutorial, or some detailed docs on how to go about adding support for a new board? I’ve been trying to figure it out just going through the source tree, but I have to admit defeat. 
> 
> For instance, there is apparently a script for connecting to the STM32F3Discovery board called stm32f3discovery.cfg that references:
> 
> # Script for connecting with the STM32F3DISCOVERY board
> source [find interface/stlink-v2.cfg]
> source [find target/stm32f3x_stlink.cfg]
> reset_config srst_only srst_nogate
> 
> But I can’t even find those files in the tree anywhere. 

those files come as part of openocd script package, so I didn’t bring them in.

> And then there’s the whole BSP and HAL work to be done. I don’t imagine there’s much to do there, as the board has a Cortex-M0 on it, so that should be pretty straightforward, but how to enable all the external sensors, etc. that are on this board? It has BLE, touch sensors, IR, temp sensor, etc. I have a complete pinout for the MCU so I know what’s hooked to what pin, etc. 
> 
> I’ve been looking through the STm32F3Discovery stuff and can’t even figure out how the pins from the MCU are mapped to pin values in mynewt (The MCU PE8 pin is an LED pin, and is somehow mapped to a pin in the 72-79 range. I’d love to know how to do this!)

Yeah, the STM32 has multiple GPIO ports with 16 pins on every port. Numbering starts from 0 -> PORT A, pin 0.
I still want to retain a flat number space for that, so what I should add is some sort of macro thing that would make
the pin numbering more understandable.

e.g.
#define PORTA(pin) (pin)
#define PORTB(pin) (16 + pin)
etc.

I have one of those boards, and thought I’d familiarize myself with the BSP/MCU stuff in mynewt by adding this BSP.
Sorry, it was a bit of a quick thing. So there are some rough edges there.

> Sorry for the naïve newby questions … 

No worries!

> dg
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.  
> * If you cannot read the PGP.sig attachment, please go to 
>  * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>  * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> ♺ This email uses 100% recycled electrons. Don't blow it by printing!
> 
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
> 
>