-
Notifications
You must be signed in to change notification settings - Fork 3k
EFR32FG support #5271
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
EFR32FG support #5271
Conversation
@ryankurte Can you please clean-up the history (lot of merge commits there, also commits that should not be mainlined) ? cc @stevew817 @akselsm |
df52436
to
b818d9d
Compare
Better? Only just discovered the magic of |
Build : SUCCESSBuild number : 33 Triggering tests/test mbed-os |
Test : FAILUREBuild number : 13 |
Test : SUCCESSBuild number : 16 |
Build : FAILUREBuild number : 57 |
rtos/TARGET_CORTEX/mbed_boot.c
Outdated
@@ -243,6 +243,7 @@ osMutexAttr_t singleton_mutex_attr; | |||
#define HEAP_START ((unsigned char*)__end__) | |||
#define HEAP_SIZE ((uint32_t)((uint32_t)INITIAL_SP - (uint32_t)HEAP_START)) | |||
#endif | |||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xc0170 This seems to be out of place?
|
||
MEMORY | ||
{ | ||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1024k |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EFR32FG1 has 256k of flash and 32k of ram...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, didn't notice the switch between the PG1B and PG12B.
targets/targets.json
Outdated
"public": false, | ||
"bootloader_supported": true | ||
}, | ||
"EFR32FG12_SLWRB4254A": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be called EFR32FG12_BRD4254A to keep in line with the naming scheme. The OPN for the standalone radio board is SLWRB*, but the board's part number is BRD*, which is what we are using here on mbed.
@@ -30,6 +30,10 @@ | |||
"EFR32MG1_BRD4150": { | |||
"sl-rail.has-2p4": true, | |||
"sl-rail.has-subgig": true | |||
}, | |||
"EFR32FG12_SLWRB4254A": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be called EFR32FG12_BRD4254A
@@ -30,6 +30,10 @@ | |||
"EFR32MG1_BRD4150": { | |||
"sl-rail.has-2p4": true, | |||
"sl-rail.has-subgig": true | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add EFR32FG1_BRD4250B as well?
I'm assuming you copied the device header files from your SDK install in Simplicity Studio? |
Yep, headers are all copied from the SDK version 5.1.3 from Simplicity Studio. |
Build : SUCCESSBuild number : 134 Triggering tests/test mbed-os |
Build : SUCCESSBuild number : 136 Triggering tests/test mbed-os |
Build : SUCCESSBuild number : 138 Triggering tests/test mbed-os |
@ryankurte What is the status of this PR after the update? |
Made the fixes proposed by @stevew817, so provided they're happy I think it's good to go? Tested running mbed client stack all ok, though I am having some wacky issues with mbed-trace and haven't got an EFR32MG to test whether it's broken on both. |
/test mbed-os |
@stevew817 Could you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/morph test |
Automatic CI verification build not done, please verify manually. |
d9f0635
to
c15ee12
Compare
Cleaned up changes to mbed_boot.c Rename SLWRB4254A -> BRD4254A
c15ee12
to
8d145e4
Compare
Cleaned up changes to mbed_boot.c Rename SLWRB4254A -> BRD4254A Fixed (Removed) INITIAL_SP override in target.json Reordered target definitions Fix INITIAL_SP override Removed incorrect radio configs
8d145e4
to
d74d7af
Compare
@@ -2951,7 +2951,7 @@ | |||
}, | |||
"EFR32MG12P332F1024GL125": { | |||
"inherits": ["EFM32"], | |||
"extra_labels_add": ["EFR32MG12", "EFR32_12", "1024K", "SL_RAIL", "SL_CRYPTO"], | |||
"extra_labels_add": ["EFR32_12", "EFR32MG12", "EFR32_12", "1024K", "SL_RAIL", "SL_CRYPTO"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added EFR32_12 and EFR32_1 labels missing from PR #5579
@0xc0170 @stevew817 updated against #5579 with new RAIL. This PR now /only/ introduces the device and board support for the FG device family. Note that PR #5742 (parameter error) and issue #5735 (missing configs) will need to be resolved for correct radio operation. |
@ryankurte Does this now support all 3 compile chains? |
It was integrated, this is ow ready for review? |
@stevew817 ^^^ |
AFAIK the new RAIL should work with all platforms (@stevew817). I don't know what executes those tests, or where from, or have the other toolchains to personally test with. I need to refactor out the library duplication I seem to have caused (see #5735), but the the RAIL cross platform issue applies to all targets with RAIL, not just this one, and could become a separate issue along with the fixes in #5742? Also as a related aside, would y'all be open to a PR of some intrinsically safe single producer/consumer queues and memory pools? Because it seems critical for driver development, and we seem to keep having to implement them because the OS ones don't work in an interrupt context. |
|
@ryankurte @stevew817 is this PR still dependent on #5735 and #5742 ? |
Oh, I thought the rtos was irq safe where useful. For example you can put/get to queues in irq: Which parts fall apart in irq context? Does the event queue work in this case? It's irq safe and rtos agnostic: I'd be curious to know what we're missing for irq context, in which case new prs are always welcome. |
@geky the main problem with the queue is that you can't allocate memory or use a memory pool (because of the stats events) from the ISR. So while you can enqueue things, you can't make anything to enqueue without a custom memory pool anyway. @cmonr depending on the result of #5735 I may no longer be able to work on this. It's only an interdependence in that the both need to be fixed, either way (without changes, or with either set of changes) the current state is broken ¯\(ツ)/¯ |
I believe the alloc and dealloc are irq safe: What do you mean by stats events? |
The memory pool by default causes RTX events that as best I can tell are for collection of pool statistics, which afaik require a syscall and results in an error in rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_evr.c#L1633. I might be wrong / it might be something else, but this is where I got by stepping out of error with the debugger. It's stated here that malloc is not officially thread safe (and there's a bunch more discussion around the pool etc.). Unfortunately I didn't document the failure, but as far as I remember malloc uses a global mutex, and mutexes don't work in ISRs for the same reason. |
Ah, if it is that specific line that is failing, that's actually due to creating the Mail object in irq, different from allocating from the Mail object. Allocating from the Mail object should end up here, though I'm not sure what goes on in the event recorder calls. If EvtRtxMemoryPoolAlloc results in a memory allocation or mutex, that's definitely a bug on our side. |
Yeah it ends up at the line you mentioned, I meant to point out that it does a whole lot of "event recording" in a whole lot of cases which is not good (tm) from an ISR. In summary:
That said, it is all more related to the #5742 stuff RAIL than this. |
@ryankurte Are you still working on this PR? |
Closing due to inactivity. @ryankurte feel free to reopen if this is a mistake or further activity is still planned or in progress. |
Description
MBed OS support for the EFR32FG chip family, based on existing EFR32MG support.
Status
READY
Related PRs
This PR depends on #5270 fix to Nanostack Efr32 driver.