summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-01-29 15:39:47 +0700
committerhathach <[email protected]>2019-01-29 17:05:53 +0700
commitc81b56eb4568d329eb3b02173771a9062c76c952 (patch)
tree1f1d3c686a84ad9f8dc9a48a040818709f7b4be4
parentd8b361fdaa463509646e04d58b355d3f6fa133da (diff)
nrf5x usb init before sd works
-rw-r--r--examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml5
-rw-r--r--examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject2
-rw-r--r--hw/bsp/pca10056/board_pca10056.c13
3 files changed, 17 insertions, 3 deletions
diff --git a/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml b/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml
new file mode 100644
index 000000000..48aad06af
--- /dev/null
+++ b/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE Board_Memory_Definition_File>
+<root name="nRF52840_xxAA_s140v6">
+ <MemorySegment name="FLASH" start="0x00026000" size="0x000C7000" access="ReadOnly" />
+ <MemorySegment name="RAM" start="0x20004000" size="0x0003C000" access="Read/Write" />
+</root>
diff --git a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
index a2d0c4a46..b859d1aad 100644
--- a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
+++ b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
@@ -116,7 +116,7 @@
<configuration
Name="pca10056 s140v6"
build_treat_warnings_as_errors="No"
- c_preprocessor_definitions="SOFTDEVICE_PRESENT"
+ c_preprocessor_definitions="SOFTDEVICE_PRESENT;S140;NO_VTOR_CONFIG"
c_user_include_directories="$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include;$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include/nrf52"
linker_memory_map_file="nRF52840_xxAA_s140v6_MemoryMap.xml" />
</project>
diff --git a/hw/bsp/pca10056/board_pca10056.c b/hw/bsp/pca10056/board_pca10056.c
index c3ac9c421..16dce465e 100644
--- a/hw/bsp/pca10056/board_pca10056.c
+++ b/hw/bsp/pca10056/board_pca10056.c
@@ -198,7 +198,7 @@ void board_init(void)
sd_power_usbregstatus_get(&usb_reg);
}else
-#else
+#endif
{
// Power module init
const nrfx_power_config_t pwr_cfg = { 0 };
@@ -212,7 +212,6 @@ void board_init(void)
usb_reg = NRF_POWER->USBREGSTATUS;
}
-#endif
if ( usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk ) {
tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_DETECTED);
@@ -251,4 +250,14 @@ void board_uart_putchar(uint8_t c)
(void) c;
}
+#ifdef SOFTDEVICE_PRESENT
+void SD_EVT_IRQHandler(void)
+{
+}
+
+void SVC_Handler( void )
+{
+}
+#endif
+
#endif