semi hosting use AngelSwi (bkpt) declare in swi.h to interact with the host semi hosting
When the core is not being debug these cause an hard fault exception and program to crash when not debugged
Hopefully We can test for presence of debugger and not issue the swi instead return -1 failure.
The easy debugger test is chip dependent (we can't include core_cm4.h) prior the chip specific file to have access to few core register we need.
So final fix impact the actual shared/common file among various all template/chips
we can modify swi.h it will impact all over usage that could be fine already
we can modify only syscall have a local DoSwi using one in swi.h after test
we can add new include file in chip src dir say "machine.h" or alike
that enable all not machine dependent file to work without change by including it
over alternative ?
For the default startup not to crash , a new HardFault_Handler is needed
we can modify one existing in CMSIS or add a new file on all template
with semi hosting based on
i'm attaching the stm32f4xx files i have changed now here for purpose of review and discussion.