From 502ab1f52413e3f542ebeb7e859ffd507a528f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 22 Mar 2018 16:08:12 +0100 Subject: [PATCH] [usb] Add comment to debug in reallocated code. Change-Id: I0b4a3e447a3a7fab1ef4778b5c3c9d4743712c46 --- ion/src/device/usb_dfu_relocated_ram.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ion/src/device/usb_dfu_relocated_ram.cpp b/ion/src/device/usb_dfu_relocated_ram.cpp index 3ec44a758..98376d348 100644 --- a/ion/src/device/usb_dfu_relocated_ram.cpp +++ b/ion/src/device/usb_dfu_relocated_ram.cpp @@ -52,6 +52,16 @@ void DFU() { * first function we want to call is at the beginning of the DFU code. */ FunctionPointer dfu_bootloader_entry = reinterpret_cast(dfu_bootloader_ram_start); + + /* To have the right debug symbols for the reallocated code, break here and: + * - Get the address of the new .text section + * In a terminal: arm-none-eabi-readelf -a ion/src/device/usb/dfu.elf + * - Delete the current symbol table + * symbol-file + * - Add the new symbol table, with the address of the new .text section + * add-symbol-file ion/src/device/usb/dfu.elf 0x20038000 + */ + dfu_bootloader_entry(); /* 5- That's all. The DFU bootloader on the stack is now dead code that will