-
Notifications
You must be signed in to change notification settings - Fork 3k
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
nRF52: Properly configure nRF SDK for nRF52-series targets #12160
Conversation
@AGlass0fMilk, thank you for your changes. |
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.
Looks good to me.
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
Looks like it could be an ARM licence issue , restarted |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
Looks like there is a genuine ARMC error as the following targets all failed:
But I cannot see why they failed! @VeliMattiLahtela any idea why these failures are not giving any details ? |
@marcuschangarm in case this sounds familiar |
@adbridge Any update on the source of the build failures? It's probably related to the macros I changed in this PR... |
@AGlass0fMilk You can review build artifacts, there are multiple defined symbols errors.
Same file as changed here. |
@0xc0170 We actually don't use |
Alright, I think I found the issue. For some reason only ARMC6 was failing even though the Nordic SDK was still pretty misconfigured. Serial API/UART FixIt seems at some point the Whoever did that migration never changed all the types to use the corresponding types from
I2C FixSimilar to the UART sitatuion, there are several peripherals that support I2C master mode. Namely, TWI and TWIM. In Mbed's case, we're using TWI (the older, deprecated peripheral supporting I2C master). The developer implementing the
This issue was fixed by simply disabling the TWIM peripheral driver in the SDK. The build runs fine, still need to test on a real target but the CI should do that... Since the TWI peripheral used by Mbed-OS's nRF52 I2C master implementation is "deprecated" it should eventually be migrated to use the TWIM. The I2CSlave implementation is already based on the (newer) TWIS peripheral so no migration effort is needed there. I don't think there's much priority to migrating until Mbed starts supporting the newer Nordic chips (91-series, 53-series, etc) |
…upt slot to the appropriate peripheral
…nused TWIM peripheral (deprecated TWI peripheral is currently used for I2C master mode operation).
da5708f
to
dc19460
Compare
Momentarily screwed up the history with the rebase but I think I fixed it 😅 |
The striked out assumptions above are wrong upon closer examination: What's really happening is when the PRS system is disabled, the IRQs for each peripheral driver actually conflict since they all point to the same function definition (see excerpt below in the case of nRF52840): mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/nrfx/soc/nrfx_irqs_nrf52840.h Lines 62 to 84 in 19e7622
With the PRS system enabled properly, the interrupts handlers then become locally-declared functions that are then installed by the PRS when Once I enabled the PRS "boxes" then all the IRQ handlers for each driver became locally-declared functions. The failure we were seeing here was that the previous developer had preprocessored-out (using mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/nrfx/drivers/src/nrfx_twi.c Lines 709 to 725 in ea3ead0
The reason it would build before was because none of the boxes were enabled so the symbols were all redirected to the global interrupt symbol for each "box" (eg: I am surprised we haven't seen any failures/issues related to this. It would only affect users trying to use asynchronous I2C and asynchronous SPI on the same instance I think... Regardless, I think the PR fixes all these issues and resources should be shared appropriately now. |
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
IAR failed , please review |
Fixed outdated references to |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Summary of changes
Properly configure Nordic platform resource sharing (PRS) API so it actually delegates the shared interrupt slot for I2C/SPI to the appropriate peripheral.
Before this, the PRS system is enabled but none of the "boxes" are. This caused only the SPI interrupt handler to be properly installed in the NVIC table.
Also updated serial API to be fully migrated to using the UARTE peripheral driver (as opposed to the deprecated UART driver). Disabled the UART and TWIM drivers as these are not used by either
serial_api.c
nori2c_api.c
and were causing build issues.Fixes #12159
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@desmond-blue