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

[NRF5] NVIC_SetVector functionality #2943

Merged
merged 8 commits into from
Oct 25, 2016

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Oct 6, 2016

Move vector to RAM. Vector is moved thanks to the Softdevice API. Peripheral IRQn that were using are now register using NVIC_SetVector in hal's drivers constructors. This cause reducing amount of memory that was waist for unused handlers code and data. Changes touch nRF5 based targets (so not legacy targets).

Were cut unused ends of vector tables in FLASH which give improvement in FLASH footprint.

@nvlsianpu
Copy link
Contributor Author

@pan- : BLE now uses NVIC_SetVector as well, vector tables in FLASH are cut as were suggested.
@anangl: could you look at.

error_t btle_init(void)
{
nrf_clock_lf_cfg_t clockConfiguration;

// register softdevice hanlder vector
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo handler

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 7, 2016

@pan- Please review

void SPIM2_SPIS2_SPI2_IRQHandler(void);

static peripheral_hanlder_desc_t spi_hanlder_desc[SPI_COUNT] = {
#if SPI0_ENABLED
Copy link
Contributor

@0xc0170 0xc0170 Oct 7, 2016

Choose a reason for hiding this comment

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

nit: #if should be at the beginning line, I see though that the rest in this file followed this one though

# Conflicts:
#	hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/serial_api.c
#	hal/targets/hal/TARGET_NORDIC/TARGET_NRF5/us_ticker.c
Reduce size of no-init section to precisely fit to size of vector in RAM.
…" includes from "target cmsis" sources

move form the path target/cmsis... and rename dispatch_IRQn_handler.c to the path target/.. and beter name.
…1822 targets.

Applied proper changes to ARM5's scatter files of nRF5 regular targets.
Improvement: Remove hardcoding of FLASH vector address, now FLASH vector address is imported form linker to C code.


Signed-off-by: Andrzej Puzdrowski <[email protected]>
Move to one IAR startup code for both varaint of RAM (16 KB & 32 KB).
void TIMER1_IRQHandler(void);
void TIMER2_IRQHandler(void);

static peripheral_hanlder_desc_t timer_handlers[] =
Copy link
Contributor

Choose a reason for hiding this comment

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

const

@@ -39,6 +39,7 @@ static const PinMap PinMap_ADC[] = {
{NC, NC, 0}
};

void ADC_IRQHandler(void); // export IRQ handler form nrf_drv_adc.c
Copy link
Contributor

Choose a reason for hiding this comment

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

typo - from

void PWM1_IRQHandler(void);
void PWM2_IRQHandler(void);

static peripheral_hanlder_desc_t pwm_handlers[PWM_INSTANCE_COUNT] =
Copy link
Contributor

Choose a reason for hiding this comment

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

const

void SPI0_TWI0_IRQHandler(void);
void SPI1_TWI1_IRQHandler(void);

static peripheral_hanlder_desc_t twi_handlers[TWI_COUNT] =
Copy link
Contributor

Choose a reason for hiding this comment

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

const

void SPI1_TWI1_IRQHandler(void);
void SPIM2_SPIS2_SPI2_IRQHandler(void);

static peripheral_hanlder_desc_t spi_hanlder_desc[SPI_COUNT] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

const

{
IRQn_Type IRQn;
uint32_t vector;
} peripheral_hanlder_desc_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

typo - handler

DCD WDT_IRQHandler_v ;WDT
DCD RTC1_IRQHandler_v ;RTC1
DCD QDEC_IRQHandler_v ;QDEC
DCD LPCOMP_COMP_IRQHandler_v ;LPCOMP_COMP
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be "LPCOMP_IRQHandler_v"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like it's artefact of a very old SDK.

@nvlsianpu nvlsianpu force-pushed the nrf_nvic_set_vector_func_trzy branch from 8172c09 to d585680 Compare October 10, 2016 09:11
…y rebase). ad applied them to

to regular targets.
Fix a typo and polish nordic's code.
@nvlsianpu nvlsianpu force-pushed the nrf_nvic_set_vector_func_trzy branch from d585680 to 8302ce0 Compare October 10, 2016 14:52
@pan-
Copy link
Member

pan- commented Oct 11, 2016

@nvlsianpu cmsis_nvic.c has not been updated for the NRF51, it has just been updated for the NRF52, this cause a crash on NRF51 targets. NRF52 targets are fine.

@pan-
Copy link
Member

pan- commented Oct 13, 2016

@0xc0170 It is good now. LGTM.

@pan-
Copy link
Member

pan- commented Oct 14, 2016

@sg- Is it possible to launch the CI for this PR ?

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 0

Test failed!

@bridadan
Copy link
Contributor

Test failure should be ok, looks like the test PC was under heavy load

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 0

All builds and test passed!

aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets


Fixes and Changes

2966: Add kw24 support ARMmbed/mbed-os#2966
3068: MultiTech mDot - clean up PeripheralPins.c and add new pin names ARMmbed/mbed-os#3068
3089: Kinetis HAL: Remove clock initialization code from serial and ticker  ARMmbed/mbed-os#3089
2943: [NRF5] NVIC_SetVector functionality ARMmbed/mbed-os#2943
2938: InterruptIn changes in NCS36510 HAL. ARMmbed/mbed-os#2938
3108: Fix sleep function for NRF52. ARMmbed/mbed-os#3108
3076: STM32F1: Correct timer master value reading ARMmbed/mbed-os#3076
3085: Add LOWPOWERTIMER capability for NUCLEO_F303ZE ARMmbed/mbed-os#3085
3046: [BEETLE] Update BLE stack on Beetle board ARMmbed/mbed-os#3046
3122: [Silicon Labs] Update of Silicon Labs HAL ARMmbed/mbed-os#3122
3022: OnSemi RAM usage fix ARMmbed/mbed-os#3022
3121: STM32F3: Correct UART4 and UART5 defines when using DEVICE_SERIAL_ASYNCH ARMmbed/mbed-os#3121
3142: Targets- NUMAKER_PFM_NUC47216 remove mbed 2 ARMmbed/mbed-os#3142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants