Compile with Visual Studio

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
nad
Posts: 30
Joined: Fri Dec 16, 2011 9:20 am

Compile with Visual Studio

Post by nad »

Hi,
I would like to know if there were any attempt to build and use ChiBios in the Visual Studio environment.
If so please let me know which version.

Thanks.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile with Visual Studio

Post by Giovanni »

Hi,

A while back I compiled the Win32 ChibiOS simulator using an old visual studio version, it worked. I don't know about recent versions.

Giovanni
nad
Posts: 30
Joined: Fri Dec 16, 2011 9:20 am

Re: Compile with Visual Studio

Post by nad »

Ok thank you for the feedback. I will give it a try on Visual Studio 2010, if you are interested in my results and need to have a project file for future builds let me know, but it depends on my success.

Keep up the good work, your RTOS is working out great.
nad
Posts: 30
Joined: Fri Dec 16, 2011 9:20 am

Re: Compile with Visual Studio

Post by nad »

Hello again,
I managed to create a Visual Studio 2010 solution/project and build with very few changes to the source code but not being a pro on assembler I could not implement port_switch() and related functions (in chcore.c/h). Speed is not of an issue, so a C implementation could be just as good if you can supply me with one.

Thanks in advance.
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Compile with Visual Studio

Post by Abhishek »

@nad, Sorry to interrupt here, but are you using a 64-bit version of Windows and trying to compile a 64-bit application? It could be the reason you're not able to compile Win32 port. However I'm not very sure.

Best Regards
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Compile with Visual Studio

Post by Giovanni »

A C implementation is not possible probably, also make sure to compile the code in a 32bits application like Abhishek suggested.

Attached there are the latest files of the very old MSVC project (2007), you may use them as starting point using them as hint on how to modify the MinGW version.

Giovanni
Attachments
msvc.zip
(2.19 KiB) Downloaded 451 times
nad
Posts: 30
Joined: Fri Dec 16, 2011 9:20 am

Re: Compile with Visual Studio

Post by nad »

Thank you Giovanni and Abhishek for the follow up.
I am compiling in 32bits, but I tried to follow what was available in the file and I was able to compile it properly. I think there are some alignment/pointer issues in port_switch() when using the mov instructions.
I tried to make some changes (the old format had the otp/ntp swapped) but with no success. Again my assembly is weak on the x86 platform.

In any case if you see any value for other ChiBios users that would be great to invest some time in fixing this, I tried but could not go much further.

Let me know. Thanks.
Post Reply