Skip to content

Fix LPC11U35_401 baremetal build #12134

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

Merged
merged 2 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion targets/TARGET_NXP/TARGET_LPC11UXX/device/cmsis_nvic.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {

// Copy and switch to dynamic vectors if first time called
if((LPC_SYSCON->SYSMEMREMAP & 0x3) != 0x1) {
uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
// Add volatile qualifier to avoid armclang aggressive optimization
volatile uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
for(i = 0; i < NVIC_NUM_VECTORS; i++) {
vectors[i] = old_vectors[i];
}
Expand Down
4 changes: 4 additions & 0 deletions targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "us_ticker_api.h"
#include "PeripheralNames.h"

#if DEVICE_USTICKER

#define US_TICKER_TIMER ((LPC_CTxxBx_Type *)LPC_CT32B1_BASE)
#define US_TICKER_TIMER_IRQn TIMER_32_1_IRQn

Expand Down Expand Up @@ -70,3 +72,5 @@ void us_ticker_free(void)
{

}

#endif // DEVICE_USTICKER
7 changes: 6 additions & 1 deletion targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,13 @@
"SERIAL",
"SLEEP",
"SPI",
"SPISLAVE"
"SPISLAVE",
"USTICKER"
],
"overrides": {
Copy link
Member

Choose a reason for hiding this comment

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

Tickless doesn't work without RTOS...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bulislaw

I needed to add tickless-from-us-ticker to avoid runtime assertion here:

MBED_ASSERT("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER" && false);

Any suggestion to avoid this assertion for the non-RTOS target?

"tickless-from-us-ticker" : true,
"boot-stack-size" : "0x400"
Copy link
Collaborator

@hugueskamba hugueskamba Jan 14, 2020

Choose a reason for hiding this comment

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

@toyowata
How did we come up with 0x400?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How did we come up with 0x400?

It is from linker script file.

Copy link
Collaborator

@hugueskamba hugueskamba Jan 14, 2020

Choose a reason for hiding this comment

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

Ah OK. Thanks.

},
"default_lib": "small",
"release_versions": ["2"],
"device_name": "LPC11U35FBD48/401"
Expand Down