Search found 65 matches

by dismirlian
Tue May 04, 2021 11:47 am
Forum: Bug Reports
Topic: Stack overflow check improvements
Replies: 11
Views: 16516

Re: Stack overflow check improvements

Yes, but what if wabase is set to tdp->wbase + PORT_GUARD_PAGE_SIZE?

Would this have any unwanted side-effect?
by dismirlian
Mon May 03, 2021 11:59 pm
Forum: Bug Reports
Topic: Stack overflow check improvements
Replies: 11
Views: 16516

Re: Stack overflow check improvements

As a minor related problem, the ChibiOS eclipse plugin incorrectly reports free stack if PORT_ENABLE_GUARD_PAGES is enabled (it counts the guard bytes as "available").
by dismirlian
Wed Apr 21, 2021 12:42 am
Forum: Bug Reports
Topic: Stack overflow check improvements
Replies: 11
Views: 16516

Re: Stack overflow check improvements

Great, thanks Giovanni.
by dismirlian
Tue Apr 20, 2021 5:42 pm
Forum: Bug Reports
Topic: Stack overflow check improvements
Replies: 11
Views: 16516

Re: Stack overflow check improvements

Hi Giovanni, combining both is a good idea.

Yes, I've turned on PORT_ENABLE_GUARD_PAGES. It didn't work at first, but that was because I didn't turn on the MPU manually (mpuEnable(MPU_CTRL_PRIVDEFENA_Msk)).

Some thoughts:
- Would it be possible for ChibiOS to turn on the MPU automatically if PORT ...
by dismirlian
Tue Apr 20, 2021 4:07 pm
Forum: Bug Reports
Topic: Stack overflow check improvements
Replies: 11
Views: 16516

Stack overflow check improvements

Hi all,

The ARM-v7m code for stack overflow detection does the following:


#define port_switch(ntp, otp) do { \
struct port_intctx *r13 = (struct port_intctx *)__get_PSP(); \
if ((stkalign_t *)(r13 - 1) < (otp)->wabase) { \
chSysHalt("stack overflow"); \
} \
__port_switch(ntp, otp ...
by dismirlian
Mon Jul 06, 2020 8:17 pm
Forum: Development and Feedback
Topic: Compilation of RT-Win32-Simulator demo with Visual Studio
Replies: 8
Views: 8088

Re: Compilation of RT-Win32-Simulator demo with Visual Studio

Hi Giovanni,

I split the patch in two:
1. enable_compilation_with_msvc: fixes compilation with MSVC for IA32 architecture.
2. rt_win32_simulator_visual_studio_project: Visual Studio project for the RT-Win32-Simulator demo project.

Thanks!
Diego.
by dismirlian
Mon Jul 06, 2020 6:03 pm
Forum: Development and Feedback
Topic: Compilation of RT-Win32-Simulator demo with Visual Studio
Replies: 8
Views: 8088

Re: Compilation of RT-Win32-Simulator demo with Visual Studio

Hi Giovanni, no problem, I know you welcome contributions!

What I meant is:
- The changes in os/... should not have a high maintenance impact; it only allows MSVC to compile the code.
- The project itself (under demos/), which may have maintenance impact, could go as a .zip in the forum or in the ...
by dismirlian
Sun Jul 05, 2020 8:26 pm
Forum: Development and Feedback
Topic: Compilation of RT-Win32-Simulator demo with Visual Studio
Replies: 8
Views: 8088

Re: Compilation of RT-Win32-Simulator demo with Visual Studio

Hi Giovanni,

2) New patch attached.

3) IMHO there is no inherent benefit in compiling with MSVC instead of GCC. The only reason I wanted this is because Visual Studio is really great for development, especially for developing the application logic, and Visual Studio handles MSVC very "naturally ...
by dismirlian
Sun Jul 05, 2020 5:37 pm
Forum: Development and Feedback
Topic: Compilation of RT-Win32-Simulator demo with Visual Studio
Replies: 8
Views: 8088

Re: Compilation of RT-Win32-Simulator demo with Visual Studio

Hi Giovanni,

1) There are no new files under compilers/GCC, I effectively created compilers/MSVC; where do you see this problem?

2) Ok, I'll try to fix/minimize those.

3) I don't know any way of using makefiles with VS, keeping the Intellisense/IDE tools working well. Do you know how to do this ...
by dismirlian
Sun Jul 05, 2020 5:10 pm
Forum: Development and Feedback
Topic: Compilation of RT-Win32-Simulator demo with Visual Studio
Replies: 8
Views: 8088

Compilation of RT-Win32-Simulator demo with Visual Studio

Hi all, I attach a patch for the stable_20.3.x branch, with minor modifications:

- Adapt some sources to be able to compile with MSVC
- Add a Visual Studio project to the RT-Win32-Simulator demo (demos/various/RT-Win32-Simulator/visual-studio).

This enables compilation with Visual Studio (which is ...