DFU: use central DFU override check

TRACE_INFO will also provide the DFU start reason, but TRACE_INFO
(TRACE_LEVEL >= 4) should only be used for debugging.
WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of
16 kiB allocated for the DFU bootloader.
Thus make combined will not boot the main application because its
start if after the expecte 16 kiB address; and flashing using DFU
will overwrite the DFU bootloader itself.

Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa
diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c
index 42231fb..bfe59ad 100644
--- a/firmware/libboard/common/source/board_cstartup_gnu.c
+++ b/firmware/libboard/common/source/board_cstartup_gnu.c
@@ -159,26 +159,12 @@
 

 

 #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu)

-    /* we are before the text segment has been relocated, so g_dfu is

-     * not initialized yet */

-    g_dfu = &_g_dfu;

-    if ((g_dfu->magic != USB_DFU_MAGIC) && !USBDFU_OverrideEnterDFU()) {

-        /* start application if valid

-         * the application starts with the vector table

-         * the first entry in the vector table is the initial stack pointer (SP) address

-         * the stack will be placed in RAM, which begins at 0x2000 0000

-         * there is up to 48 KB of RAM (0xc000)

-         * since the stack grown "downwards" it should start at the end of the RAM: max 0x2000 c000

-         * if the SP is not in this range (e.g. flash has been erased) there is no valid application

-         * the second entry in the vector table is the reset address, corresponding to the application start

-         */

-        if (((*((uint32_t*)(IFLASH_ADDR+BOARD_DFU_BOOT_SIZE)))&0xFFFF0000)==0x20000000) {

-            UART_Exit();

-            __disable_irq();

-            BootIntoApp();

-            /* Infinite loop */

-            while ( 1 ) ;

-        }

+    if (!USBDFU_OverrideEnterDFU()) {

+        UART_Exit();

+        __disable_irq();

+        BootIntoApp();

+        /* Infinite loop */

+        while ( 1 ) ;

     }

 #endif