Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) Export binary file for Pi (Read 14576 times)
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Export binary file for Pi
May 11th, 2018 at 3:01pm
Print Post  
Hi
I am testing the Arduino code compiled for Pi https://github.com/me-no-dev/RasPiArduino
It works fine in the Arduino IDE but I cannot seem to find the binary export function in VM.

Also how to edit the ino file that is on the share drive on the Pi instead of the local copy.


  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #1 - May 12th, 2018 at 4:27pm
Print Post  
You should find a new menu item in the next release called "vMicro>Compiler>Always Export Binary". Check the menu and the file is copied into the project folder after each build.

Download link in the next release post

fyi: The build output is also available under the folder specified in project property pages > Final build output folder". Normally that is solutionLocation/Release or solutionLocation/Debug. In the case of the pi it appears the .hex is renamed to "project.variant.bin" and copied to the project folder. This info enables an older build to be uploaded if required.
« Last Edit: May 12th, 2018 at 4:28pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #2 - May 13th, 2018 at 9:53am
Print Post  
Thanks Tim

I found that if I load the solution from the PI it works as well but is not optimal. 
I also found that one can execute the hex file on the Pi.

I must say that coping only the binary to the target is much better so I wait to test he new release Smiley.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #3 - May 13th, 2018 at 12:11pm
Print Post  
Sorry I wasn't clear. The update is already available with the link I provided.
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #4 - May 14th, 2018 at 9:47am
Print Post  
I installed the latest version. It does create a file project.ino.hex that I assume is the binary. I cannot seem to find a way to set where it puts the binary in a target directory.

If it is not possible now it would be a great feature to be able to tell the builder where to put the binary. In my case \\192.168.1.106\Arduino\project. This is a share that was created with samba.

  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #5 - May 14th, 2018 at 9:21pm
Print Post  
Oh I see. Yes I can add a board.txt property to enable you to set the path

The binary file name is specified in the platform.txt of whatever board you are using. So .hex is what 

If you switch on vmicro>compiler>verbose and then build you should see the export command in the output

For the Pi that I have installed it produced a .bin which is actually the .hex from the build folder.

# Export Binary: tch1.ino.hex to file:///C:\Users\tl\Documents\Arduino\TestSketch1\TestSketch1.ino.bplus.bin

1)
What do you see

2)
How does the arduino ide handle this?
« Last Edit: May 14th, 2018 at 9:28pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #6 - May 15th, 2018 at 10:55am
Print Post  
I see exactly the same output and I tested the Arduino IDE and it is the same as well.

What makes this setup different is that it runs on another computer that does not have an upload facility.

I would suggest that we have an option to select a network mapped drive to export the binary too or have an upload function that will do just that. One will have to provide the samba share on the target and map that share as a drive on the PC side with Explorer.

« Last Edit: May 15th, 2018 at 11:00am by Marius »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #7 - May 15th, 2018 at 12:05pm
Print Post  
Thanks for the info.

Normally for IP devices we use the facility first introduced for the Arduino Yun which uses SSH to upload. However it's not very nice Smiley

1)
Because you have a mapped drive it makes life easy. We can have a new property in the project to allow the path to be set that the export will use. It seems that might then be better to have the export happen when upload is clicked or when use manually clicks export because the copy might be slow?

2)
Alternatively we could create the export in the output folder such as Project\Debug. Actually the output folder can already be configured by you in the Visual Studio Project Property Pages. It's a standard visual studio project property called Final Output Folder. This solution would place all .o, .hex, .elf etc in the specified final output folder which might or might not be what is required. If this is a good solution it would negate the need for 1)

3)
I have a Pi Zero and am trying to make a simple setup guide for users. The toolchain and Arduino build is no problem. Loading Jessie onto the SD is no problem but how do I configure the IP address in the simplest possible way?

Thanks

  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #8 - May 15th, 2018 at 12:32pm
Print Post  
On point 2) I cannot find that option in VS2012 at all. I agree that would be the easiest if I could find it.

If you download the latest Raspbian stretch (Jessie will also do) it will use your network DHCP to determine the IP.

To set it manually, open a terminal on the desktop and follow this tutorial. There are many to choose from if this is not good for you.

https://www.modmypi.com/blog/how-to-give-your-raspberry-pi-a-static-ip-address-u...
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #9 - May 15th, 2018 at 12:46pm
Print Post  
Great thanks.

For 2), although it won't have the project.devicetype.bin right now but you can put a file in the folder and try it. If it works I can change the export to be in that folder instead of the project folder or both.

To find 2) right click the project in solution explore and choose "Properties"

RIGHT CLICK PROJECT NAME > PROPERTIES
« Last Edit: May 15th, 2018 at 12:46pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #10 - May 15th, 2018 at 2:12pm
Print Post  
This is what I set it to from the beginning. I did not realize it was the same setting that you referred to. 
As you said it does not contain the binary but nor does it contain anything else. Is that normal?
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #11 - May 15th, 2018 at 2:16pm
Print Post  
No, that suggests permissions issue. Try running VS as administrator to prove this out.

It fails silently if it can't copy the files because most arduino users don't understand or need this process.

The .hex is the .bin. The .bin is the .hex renamed by the export. We just need to know the copy works then I can make the export put the bin in the output folder instead of the project folder. It currently exports to the project folder because that is what arduino does.

« Last Edit: May 15th, 2018 at 2:19pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #12 - May 15th, 2018 at 2:48pm
Print Post  
If you use a share drive that is mapped in explorer then you are logged in as the user on the pi zero already. I just use the explorer to copy and paste straight to the mapped drive. That is the joy of using samba.

You can execute the .hex or the .bin on the pi it does not care.

This is a good tutorial to get the setup correct on the pi  https://www.youtube.com/watch?v=lZvhtfUlY8Y 

It's a bit tedious but worth the watch.

This is the follow up and the actual one you want to watch https://www.youtube.com/watch?v=sd5NLSKp1QU
« Last Edit: May 15th, 2018 at 2:51pm by Marius »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #13 - May 15th, 2018 at 2:50pm
Print Post  
Okay great thanks. Does the copy work now in admin mode? The .hex will be there won't have device variant name in the name.
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #14 - May 15th, 2018 at 2:52pm
Print Post  
no it does not copy either.

This is the better movie to watch https://www.youtube.com/watch?v=sd5NLSKp1QU
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #15 - May 15th, 2018 at 2:58pm
Print Post  
ok will have a go next day or so
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Export binary file for Pi
Reply #16 - May 16th, 2018 at 2:54pm
Print Post  
forgot to ask, how to set the SSID and Password for the router providing the DHCP?

Thanks
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #17 - May 16th, 2018 at 3:10pm
Print Post  
It's best to do that from the Rpi desktop. You can do the LAN and WAN by using the GUI on the desktop. Pretty much the same as you would set a fixed ip for windows.

SO you only have to connect the screen once when you set up the Pi. After that you can configure it to not use the desktop. You run a command on a terminal "sudo rasp-config" and set all the hardware and software stuff. You can select there if you want to boot to CLI or desktop.

I use a program called Angry IP Scanner to find the Rpi IP and the use MobaXterm to log onto the Pi.


If you want to go by the command line then:

Code
Select All
Edit the file /etc/dhcpcd.conf as follows:

    Type sudo nano /etc/dhcpcd.conf at the command prompt.

    Scroll to the bottom of the script, and add the following lines:

    interface eth0

    static ip_address=192.168.0.2/24
    static routers=192.168.0.1
    static domain_name_servers=192.168.0.1

    interface wlan0

    static ip_address=192.168.0.2/24
    static routers=192.168.0.1
    static domain_name_servers=192.168.0.1

    Save the file with ctrl + o and then exit nano with ctrl + x.

Your Raspberry Pi will now boot up with the IP address 192.168.0.2 every time;
we didn't use 192.168.0.1 as this is reserved for the router.
You can of course use any address you like, but in the configuration above the range must be between
192.168.0.2 and 192.168.0.255. 

« Last Edit: May 16th, 2018 at 3:12pm by Marius »  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #18 - May 16th, 2018 at 3:19pm
Print Post  
As a matter of fact you are compelled to use the screen first time as it seems that the SSH server is not enabled by default. You set that up via a terminal and raspi-config of from the menu you set the preferences.
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Export binary file for Pi
Reply #19 - May 16th, 2018 at 4:56pm
Print Post  
The zero does not have an Ethernet or wireless function so I use a USB to Ethernet adapter to connect with it.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint