Skip to content
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: slwstk6000b: add support #8824

Merged
merged 4 commits into from
Apr 6, 2018

Conversation

basilfx
Copy link
Member

@basilfx basilfx commented Mar 22, 2018

Contribution description

This PR add supports for the Silicon Labs SLWSTK6000B development kit for wireless applications. Although the files are very similar to the other PRs I have submitted, this board is actually a base board that can host different CPU modules. All CPU modules have fixed pins for certain functions, including ones for the onboard LCD and Si7021 temperature sensor.

I came up with an idea similar to how I supported the EFM32 family, by using modules.txt as a 'database' for mapping the base board to a CPU module. I don't think duplicating this board for all the different modules would work out.

To compile, you actually have to override the BOARD_MODULE (defaults to SLWBR4162a) using something like this:

BOARD=slwstk6000b BOARD_MODULE=slwrb4162a make -j8

I currently have two CPU modules supported: SLWBR4150A and SLWBR4162A. However, there are 15+ more modules that fit this base board.

Issues/PRs references

#8585
#8520
#8630
#8569

@basilfx basilfx added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: boards Area: Board ports labels Mar 22, 2018
@basilfx basilfx requested review from jia200x and kYc0o March 22, 2018 21:21
@basilfx
Copy link
Member Author

basilfx commented Mar 22, 2018

Asking @kaibeckmann to test this PR, since he has access to the boards.

@kaibeckmann
Copy link

Hey I found a couple of things.
For the two modules I tested, the cpu was wrong. Therefore the right header files were missing:

  • efr32mg1p233f256gm48.h
  • efr32mg12p332f1024gl125.h

I like the submodule system, but I think the new definition for the pins is not necessary. First the names are derived from the slwrb4162a, but the datesheets of the other modules have different names for the pins with the same GPIO. That is quite confusing. And than it's not necessary, because the GPIOs seem to be the same (at least for the 3 or 4 datasheets I checked).

The main difference of the modules are the cpu and additional periphery, like SPI-Flash, Touch-Slider, radio transceiver and if there are separate GPIOs to enable sensors, dispay etc.

@basilfx
Copy link
Member Author

basilfx commented Mar 25, 2018

Thanks @kaibeckmann for testing.

The mapping of modules to CPU is based on the list on the page of the SLWSTK6000B itself.

However, looking at the reference manuals, I do see different MCU's being used. I'll ask Silicon Labs to update their list, somehow.

Regarding the pin numbers: it is needed. If you look at the reference manuals, you can see that some MCU pins map to different module pins. For instance, the brd4150a maps P0 to PA2, but it maps P0 to PD8 on the brd4162a. Then there are also a lot of pins that aren't connected on some boards.

The pin numbers are confusing at first, because they don't link to the reference manuals, where you can see the actual module pins. Here are some:

@kaibeckmann
Copy link

Hmm I see your point, but the module pin names are confusing. It makes the understanding and using of the boards for someone new more complex.

Maybe a more elaborate name schema would help? Something like MODULE_PIN_P0 ?

If the MCU pin for the basic peripherals really can change, than the multiplexing part should properly be moved to the module header as well (UART, I2C, SPI, ...).

@basilfx
Copy link
Member Author

basilfx commented Mar 26, 2018

I can change it to MODULE_PIN_P0. That is a better name, and I will also put in the docs that it concerns the module pinout.

I haven't encountered a reason for moving the multiplexing part as well, but if it is necessary, I'll do it. I want to keep as much as possible in board.h and periph_conf.h.

@basilfx basilfx added CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 26, 2018
@basilfx
Copy link
Member Author

basilfx commented Mar 26, 2018

I have fixed the board name to module mapping, based on the reference manuals and renamed the pin names.

Copy link

@kaibeckmann kaibeckmann left a comment

Choose a reason for hiding this comment

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

I think I should have pressed the "submit review" button ...
Some smaller issues / bugs.


# setup JLink for flashing
export JLINK_DEVICE := $(CPU_MODEL)
include $(RIOTMAKE)/tools/jlink.inc.mk

Choose a reason for hiding this comment

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

Debugging does not work for me, as long as the DBG variable is not set to the gdb program.
I had added following lines between line 18 and 19 in my version:

include $(RIOTMAKE)/tools/gdb.inc.mk
export DBG:=$(GDB)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is a bug. I compared JLink with OpenOCD, and OpenOCD sets DBG=GDB, but JLink doesn't. Will look into this tonight.

Copy link
Member Author

Choose a reason for hiding this comment

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

#8853 should address this.

};

#define I2C_NUMOF PERIPH_NUMOF(i2c_config)
#define I2C_0_ISR isr_i2c1

Choose a reason for hiding this comment

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

that is the wrong isr handler, must be isr_i2c0

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

{
.dev = USART0,
.rx_pin = F6,
.tx_pin = F7,

Choose a reason for hiding this comment

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

RX and TX are swaped.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

include $(RIOTMAKE)/tools/serial.inc.mk

# setup JLink for flashing
export JLINK_DEVICE := $(CPU_MODEL)

Choose a reason for hiding this comment

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

the $(CPU_MODEL) does not work for the EFR32MG1P family. For these the string EFR32MG1PxxxF256 is needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added additional data in modules.txt.

@basilfx
Copy link
Member Author

basilfx commented Apr 3, 2018

@kaibeckmann do the latest adaptions work for you? The debug problem should now be addressed.

@kaibeckmann
Copy link

OK I tested it for the slwrb4150a and slwrb4162a with the default app and the tests-core. It works fine.

@basilfx
Copy link
Member Author

basilfx commented Apr 4, 2018

Updated vendor headers per #8873.

@kaibeckmann
Copy link

kaibeckmann commented Apr 5, 2018

OK I ran the tests again, everything is working as expected.

@basilfx
Copy link
Member Author

basilfx commented Apr 5, 2018

Ping @kYc0o or @jia200x.

#define MODULE_PIN_P43 GPIO_PIN(PF, 10)
#define MODULE_PIN_P44 GPIO_PIN(PF, 11)
#define MODULE_PIN_P45 GPIO_PIN(PF, 12)
/** @} */
Copy link
Contributor

Choose a reason for hiding this comment

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

How different are these definitions to the ones for the other module?

Copy link
Member Author

Choose a reason for hiding this comment

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

So far as I can tell, different enough. There are modules that only define half of these pins.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was just wondering if we could merge them in a single file (with #ifdefs), since I see that at least the beginning of the definitions are the same.

Copy link
Member Author

@basilfx basilfx Apr 5, 2018

Choose a reason for hiding this comment

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

I propose to start this way, and change if it turns out to be easier to combine in the future.

I expect that there might be additional features or possibilities, looking at the list of supported modules (bottom three for example).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, please squash.

@@ -0,0 +1,135 @@
/*
* Copyright (C) 2015-2018 Freie Universität Berlin
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Freie Universität?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, file was copy-pasted from EZR32WG, by @haukepetersen.

@basilfx basilfx added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 5, 2018
@basilfx
Copy link
Member Author

basilfx commented Apr 5, 2018

Squashed and rebased. Murdock is happy.

@basilfx
Copy link
Member Author

basilfx commented Apr 6, 2018

@kYc0o @kaibeckmann Good to go?

Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

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

Good for me, ACK.

@kYc0o kYc0o merged commit ce43846 into RIOT-OS:master Apr 6, 2018
@basilfx
Copy link
Member Author

basilfx commented Apr 6, 2018

Thanks!

@basilfx basilfx deleted the feature/efm32_slwstk6200b branch April 12, 2023 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants