From 47408bb9dd8d45a285c6f945eecee7bcc6f307c2 Mon Sep 17 00:00:00 2001 From: Lorne Smith <65424047+lorne-maxim@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:03:38 -0500 Subject: [PATCH] fix(Tools): Update Keil support for ECC enabled versions of the MAX32675 (#1001) Co-authored-by: lorne-maxim Co-authored-by: Sihyung Woo <75494566+sihyung-maxim@users.noreply.github.com> --- .../Maxim/MAX32675/Source/system_max32675.c | 6 +++++ Tools/Keil/MAX32675.sct | 23 +++++++++++++++++++ Tools/Keil/project_wizard/README.md | 18 ++++++++------- 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 Tools/Keil/MAX32675.sct diff --git a/Libraries/CMSIS/Device/Maxim/MAX32675/Source/system_max32675.c b/Libraries/CMSIS/Device/Maxim/MAX32675/Source/system_max32675.c index 0b9b117f24..190e2b2185 100644 --- a/Libraries/CMSIS/Device/Maxim/MAX32675/Source/system_max32675.c +++ b/Libraries/CMSIS/Device/Maxim/MAX32675/Source/system_max32675.c @@ -167,6 +167,12 @@ __weak void SystemInit(void) MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO0); MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO1); + /* Various revisions of the MAX32675 have different startup frequencies. + Calling SystemCoreClockUpdate will examine the part's registers to + determine the correct initial value for the SystemCoreClock variable. + */ + SystemCoreClockUpdate(); + PinInit(); Board_Init(); } diff --git a/Tools/Keil/MAX32675.sct b/Tools/Keil/MAX32675.sct new file mode 100644 index 0000000000..3e2edfd228 --- /dev/null +++ b/Tools/Keil/MAX32675.sct @@ -0,0 +1,23 @@ +LR_IROM1 0x10000000 0x60000 +{ + ER_IROM1 0x10000000 0x60000 + { + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + .ANY (+XO) + } + + PAD_IROM1 +0 ALIGN 16 EMPTY 0 + { + ; This empty region forces the previous region to + ; always be a multiple of 16 bytes. This is + ; necessary for devices where flash ECC is enabled. + } + + RW_IRAM1 0x20000000 0x00028000 + { + .ANY (+RW +ZI) + } +} + diff --git a/Tools/Keil/project_wizard/README.md b/Tools/Keil/project_wizard/README.md index 9d97232cd8..e9325abed6 100644 --- a/Tools/Keil/project_wizard/README.md +++ b/Tools/Keil/project_wizard/README.md @@ -23,7 +23,7 @@ To properly setup your project using the Project Wizard App, follow these steps: - `Pack Installer` menu location: ![Pack Installer Location](https://github.com/analogdevicesinc/msdk/blob/feat/keil_project_wizard/Tools/Keil/project_wizard/docs/pack_installer_location.png) 5. Find `Maxim` -> `MAX32675 Family` and select the `MAX32675`. 6. Open the `Packs` Tab (usually on the right half column) and expand `Device Specific`. -7. Install the `Maxim::MAX32675` v1.3.0 pack file. +7. Install the `Maxim::MAX32675` v1.3.1 pack file. 8. Close Keil. 9. Run the Project Wizard App located in the cloned MSDK repository - located in `msdk/Tools/Keil/project_wizard/project_wizard.exe`. 10. Fill in desired project settings in the opened GUI. @@ -41,13 +41,15 @@ To properly setup your project using the Project Wizard App, follow these steps: - Press `ALT+F7` for macro shortcut to `Options for Target...`. 14. In the `Target` Tab -> `Code Generation` section -> `ARM Compiler` options, select `Use default compiler version 6`. 15. In the `C/C++ (AC6)` Tab -> `Language / COde Generation` section -> `Language C:` options, select `c99`. -16. In the `Debug` Tab -> Top right corner, select the `CMSIS-DAP Debugger` or the board's supported debugger adapter. - - (Optional) Press the `Run to main()` checkbox right underneath the debugger adapter selector. -17. In the `Utilities` Tab, press the `Settings` button in the `Configure Flash Menu Command` section. A `Target Driver Setup` window should open. -18. In the `Flash Download` Tab, click the `Erase Full Chip` option in the `Download Function` section. -19. In the `Debug` Tab, within the sections `Debug` -> `Connect & Reset Options`, select the `Reset:` option to `VECTRESET`. -20. Press `OK` to save everything. -21. Build and load the project. Enjoy! +16. In the `Linker` Tab, uncheck `Use Memory Layout from Target Dialog`. +17. Use the browse button (`...`) next to the `Scatter File` text box to select the `MAX32675.sct` file located in the `Tools/Keil/` folder of the MSDK repository you cloned in step #2. +18. In the `Debug` Tab -> Top right corner, select the `CMSIS-DAP Debugger` or the board's supported debugger adapter. +19. In the `Utilities` Tab, press the `Settings` button in the `Configure Flash Menu Command` section. A `Target Driver Setup` window should open. +20. In the `Flash Download` Tab, click the `Erase Full Chip` option in the `Download Function` section. +21. In the `RAM for Algorithm`, set the `Size` field to `0x3000`. +22. If using the `CMSIS-DAP Debugger` from step **18**: In the `Debug` Tab, within the sections `Debug` -> `Connect & Reset Options`, select the `Reset:` option to `VECTRESET`. +23. Press `OK` to save everything. +24. Build and load the project. Enjoy! ### Support