Skip to content

Commit 5649eef

Browse files
committed
Enabled nRF52840_DK's compilation for IAR IDE:
- corected scater & startup file for IAR EW - fix warnings caused by port_api.c, ble_radio_notification.c, nrf_drv_spi.c (for IAR it was error), serial_api.c
1 parent 46f7277 commit 5649eef

File tree

6 files changed

+49
-12
lines changed

6 files changed

+49
-12
lines changed

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
44
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x1c000;
5+
define symbol __ICFEDIT_intvec_start__ = 0x21000;
66
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x1c000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x7ffff;
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x21000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0xfffff;
99
define symbol __ICFEDIT_region_RAM_start__ = 0x20002ef8;
10-
define symbol __ICFEDIT_region_RAM_end__ = 0x2000ffff;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x2003ffff;
1111
export symbol __ICFEDIT_region_RAM_start__;
1212
export symbol __ICFEDIT_region_RAM_end__;
1313
/*-Sizes-*/

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/startup_NRF52832_IAR.s

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ __vector_table
118118
DCD RTC2_IRQHandler_v
119119
DCD I2S_IRQHandler_v
120120
DCD FPU_IRQHandler_v
121-
121+
DCD USBD_IRQHandler_v
122+
DCD UARTE1_IRQHandler_v
123+
DCD QSPI_IRQHandler_v
124+
DCD CRYPTOCELL_IRQHandler_v
125+
DCD SPIM3_IRQHandler_v
126+
DCD 0 /*Reserved */
127+
DCD PWM3_IRQHandler_v
122128

123129
__Vectors_End
124130
__Vectors EQU __vector_table
@@ -375,6 +381,36 @@ I2S_IRQHandler_v
375381
FPU_IRQHandler_v
376382
B .
377383

384+
PUBWEAK USBD_IRQHandler_v
385+
SECTION .text:CODE:NOROOT(1)
386+
USBD_IRQHandler_v
387+
B .
388+
389+
PUBWEAK UARTE1_IRQHandler_v
390+
SECTION .text:CODE:NOROOT(1)
391+
UARTE1_IRQHandler_v
392+
B .
393+
394+
PUBWEAK QSPI_IRQHandler_v
395+
SECTION .text:CODE:NOROOT(1)
396+
QSPI_IRQHandler_v
397+
B .
398+
399+
PUBWEAK CRYPTOCELL_IRQHandler_v
400+
SECTION .text:CODE:NOROOT(1)
401+
CRYPTOCELL_IRQHandler_v
402+
B .
403+
404+
PUBWEAK SPIM3_IRQHandler_v
405+
SECTION .text:CODE:NOROOT(1)
406+
SPIM3_IRQHandler_v
407+
B .
408+
409+
PUBWEAK PWM3_IRQHandler_v
410+
SECTION .text:CODE:NOROOT(1)
411+
PWM3_IRQHandler_v
412+
B .
413+
378414

379415
END
380416

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/port_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static NRF_GPIO_Type * const m_ports[] = GPIO_REG_LIST;
4545

4646
PinName port_pin(PortName port, int pin_n)
4747
{
48-
return NRF_GPIO_PIN_MAP(port, pin_n);
48+
return (PinName)NRF_GPIO_PIN_MAP(port, pin_n);
4949
}
5050

5151
void port_init(port_t *obj, PortName port, int mask, PinDirection dir)

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/ble/ble_radio_notification/ble_radio_notification.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
*/
3838

3939
#include "ble_radio_notification.h"
40+
#include "nrf_nvic.h"
4041
#include <stdlib.h>
4142

4243

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/sdk/drivers_nrf/spi_master/nrf_drv_spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ void nrf_drv_spi_abort(nrf_drv_spi_t const * p_instance)
611611

612612
CODE_FOR_SPIM
613613
(
614-
nrf_spim_task_trigger(p_instance, NRF_SPIM_TASK_STOP);
615-
while (!nrf_spim_event_check(p_instance, NRF_SPIM_EVENT_STOPPED)) {}
614+
nrf_spim_task_trigger(p_instance->p_registers, NRF_SPIM_TASK_STOP);
615+
while (!nrf_spim_event_check(p_instance->p_registers, NRF_SPIM_EVENT_STOPPED)) {}
616616
p_cb->transfer_in_progress = false;
617617
)
618618
CODE_FOR_SPI

targets/TARGET_NORDIC/TARGET_NRF5_SDK13/serial_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
283283
nrf_uart_enable(UART_INSTANCE);
284284
}
285285
else {
286-
UART_CB.baudrate = UART_DEFAULT_BAUDRATE;
287-
UART_CB.parity = UART_DEFAULT_PARITY;
288-
UART_CB.hwfc = UART_DEFAULT_HWFC;
286+
UART_CB.baudrate = (nrf_uart_baudrate_t)UART_DEFAULT_BAUDRATE;
287+
UART_CB.parity = (nrf_uart_parity_t)UART_DEFAULT_PARITY;
288+
UART_CB.hwfc = (nrf_uart_hwfc_t)UART_DEFAULT_HWFC;
289289
UART_CB.pselcts = UART_DEFAULT_CTS;
290290
UART_CB.pselrts = UART_DEFAULT_RTS;
291291

@@ -554,7 +554,7 @@ static void internal_set_hwfc(FlowControl type,
554554
nrf_gpio_cfg_input(UART_CB.pselcts, NRF_GPIO_PIN_NOPULL);
555555
}
556556

557-
UART_CB.hwfc = (type == FlowControlNone)? NRF_UART_HWFC_DISABLED : UART_DEFAULT_CONFIG_HWFC;
557+
UART_CB.hwfc = (nrf_uart_hwfc_t)((type == FlowControlNone)? NRF_UART_HWFC_DISABLED : UART_DEFAULT_CONFIG_HWFC);
558558

559559
nrf_uart_configure(UART_INSTANCE, UART_CB.parity, UART_CB.hwfc);
560560
nrf_uart_hwfc_pins_set(UART_INSTANCE, UART_CB.pselrts, UART_CB.pselcts);

0 commit comments

Comments
 (0)