Using: Eclipse Studio on Win10
Notes: Only works when Eclipse IDE is in debug mode
Apply Linker Argument Settings
Right click on Project
Properties
C/C++ Build
Settings
MCU G++ Linker
Miscellaneous
In the Linker Flags box, type:
-specs=rdimon.specs -lc -lrdimon
At the bottom of the window, click “Apply”
OK.
While we’re here… if we try to print variables right now, we’ll break the compiler because we haven’t set up the floating point hardware. Change the floating point hardware to ‘No Unit’ Change the Floating-point ABI to Software: ‘soft’
OK.
Close
Set Debug Configuration
Clean, and Build your project so you get a binary file:
Right click on project
Build Project
See binary file
Right click on Project
Debug As
Debug Configurations
Startup Tab
Select the Binary File from the list (*Debug file)
In the Run Commands box type:
monitor arm semihosting enable
Click Apply
- Set the Debug Configuration:
Build your project so you get a binary file
Right click on project
Build Project
Close.
Open the application code for your project
(eg main.c)Add to the file:
extern void initialize_monitor_handles();
ALSO make sure you #include <stdio.h>
In the main function of the main file, add the initialization function (yep, we're British here):
initialise_monitor_handles();
Exclude sysmem.c from the build
Go to the Project Tree
Expand startup
Right click on sysmem.c
Resource Configuration
Exclude from Build
Debug and Release. OK.
Add a ‘printf’ statement to your code.
BE SURE TO END WITH “\n”Clean Project
Build Project
Debug
Open the Console Tab
No comments:
Post a Comment