Skip to content

nrf: support for SoftDevice s140 PCA10056 board#723

Merged
aykevl merged 1 commit into
tinygo-org:devfrom
thegrumpylion:s140
Nov 20, 2019
Merged

nrf: support for SoftDevice s140 PCA10056 board#723
aykevl merged 1 commit into
tinygo-org:devfrom
thegrumpylion:s140

Conversation

@thegrumpylion

Copy link
Copy Markdown
Contributor

My source for the linker script file are the ble examples in nRF5 SDK v16.0.0. I am not sure if the values are correct but for the FLASH_TEXT the value is the same in all examples for pca10056. Now for the RAM origin seems to be application dependent. Is this correct?

@aykevl

aykevl commented Nov 15, 2019

Copy link
Copy Markdown
Member

I am not sure if the values are correct but for the FLASH_TEXT the value is the same in all examples for pca10056. Now for the RAM origin seems to be application dependent. Is this correct?

That's correct. The flash size is fixed for a major revision number and the RAM size is application-dependent. However, it's currently fixed in TinyGo.

Sources:

@aykevl aykevl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, can you also add a smoketest to make sure this configuration keeps compiling in the future?
For comparison:

tinygo/Makefile

Lines 190 to 191 in 009b273

$(TINYGO) build -size short -o test.hex -target=pca10040-s132v6 examples/blinky1
@$(MD5SUM) test.hex

@deadprogram

Copy link
Copy Markdown
Member

Would this be the same basic setup to use with the reel board if loaded with the s140 softdevice?

@thegrumpylion

thegrumpylion commented Nov 18, 2019

Copy link
Copy Markdown
Contributor Author

However, it's currently fixed in TinyGo.

And that value is 0x20000000 + 0x000039c0 as in S132? Also, can you please explain why is fixed in TinyGo? Is it fixed by choice or some other factors?

Actually, can you also add a smoketest to make sure this configuration keeps compiling in the future?

Sure.

Would this be the same basic setup to use with the reel board if loaded with the s140 softdevice?

It should be (tm). I have also an nRF52840-mdk board that i would like to have S140 working on it but needs a bit of work as in creating a single .hex file since the bootloader is CMSIS-DAP and nrfjprog doesn't work

@aykevl

aykevl commented Nov 18, 2019

Copy link
Copy Markdown
Member

And that value is 0x20000000 + 0x000039c0 as in S132? Also, can you please explain why is fixed in TinyGo? Is it fixed by choice or some other factors?

The RAM used/required by the SoftDevice can be configured, but must be set at compile time (because it is part of the linker script). Ideally you could configure this per application and eventually support for this should be added, but until then I think it's best to pick a reasonable number and use that. 0x39c0 (~14.4kB) should definitely be enough.

The amount of RAM required varies by application because different applications may use different features of the SoftDevice. This is configured when the SoftDevice is initialized, but at the moment go-bluetooth uses a fixed configuration with a fixed amount of memory required.
For more information, see sd_ble_cfg_set and sd_ble_enable.

I have also an nRF52840-mdk board that i would like to have S140 working on it but needs a bit of work as in creating a single .hex file since the bootloader is CMSIS-DAP and nrfjprog doesn't work

I believe you can also flash the SoftDevice using OpenOCD (it certainly worked on nrf51 devices). After that, you can just use tinygo flash -taget=nrf52840-mdk.

@thegrumpylion

Copy link
Copy Markdown
Contributor Author

@aykevl Thank you for the information and for the pointers. Everything is clear now.

@thegrumpylion thegrumpylion marked this pull request as ready for review November 18, 2019 15:47
@aykevl aykevl merged commit c09724b into tinygo-org:dev Nov 20, 2019
@aykevl

aykevl commented Nov 20, 2019

Copy link
Copy Markdown
Member

Thank you for this contribution, merged now.

@thegrumpylion

Copy link
Copy Markdown
Contributor Author

Yay! My first contribution to TinyGo!! The first of many i hope :)

@thegrumpylion thegrumpylion deleted the s140 branch November 20, 2019 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants