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 Send TopicPrint
Hot Topic (More than 8 Replies) How to copy boards (Read 7525 times)
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
How to copy boards
Mar 21st, 2018 at 1:51pm
Print Post  
I came across this form while working on a project for a USB MIDI controller. I'm trying to figure out how rename my board's device name and was trying to figure out where boards.txt was located.

On another topic, is there a easy way to rename a device's name in VM?
« Last Edit: Mar 21st, 2018 at 8:47pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with setup forms on high-res monitor
Reply #1 - Mar 21st, 2018 at 2:51pm
Print Post  
Do you mean board name or usb device name?
  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: Problem with setup forms on high-res monitor
Reply #2 - Mar 21st, 2018 at 3:43pm
Print Post  
USB device name.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem with setup forms on high-res monitor
Reply #3 - Mar 21st, 2018 at 4:48pm
Print Post  
You might have to change that in Device Manager if that is possible. Visual Micro reads the WMI database to discover device names.

However it does also attempt to match the VID/PID with board.txt so you are right to consider that.

You have not said which hardware you have or what cores you have installed so you have two options

1) if you are using arduino with AVR and have not used board manager then the boards.txt will be in arduinoide\hardware\arduino\avr\...

2) If you have used board manager then open the visual micro explore, click the Board Manager tab then hover the mouse over your hardware. The location of the boards.txt will be shown as links in the info panel at the bottom of the explorer.

If you make changes to boards.txt then click Rescan or restart the ide.
« Last Edit: Mar 21st, 2018 at 4:48pm by Tim@Visual Micro »  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: Problem with setup forms on high-res monitor
Reply #4 - Mar 21st, 2018 at 5:05pm
Print Post  
I'm using a SparkFun Pro Micro with an ATMega32U4. Is it possible to use a local boards.txt with VM, so that I don't have to change the original?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to copy boards?
Reply #5 - Mar 21st, 2018 at 8:46pm
Print Post  
You can copy boards in boards.txt or you can add your own boards.txt to the arduino sketchbook\hardware folder

For example I created a copy of the Uno board to a boards.txt that I created in :-myDocuments\Arduino\Hardware\MyBoards\avr\boards.txt


The definition is the same as the original with 3 minor changes. You probably only need the first two if sparkfun uses the arduino core from the ide.

1) Renamed the BoardID. to myuno.
2) Renamed the board name from "Arduino/Genuino Uno" to "Test Uno"
3) Changed core=arduino to core=arduino:arduino

Code
Select All
myuno.name=Test Uno

myuno.vid.0=0x2341
myuno.pid.0=0x0043
myuno.vid.1=0x2341
myuno.pid.1=0x0001
myuno.vid.2=0x2A03
myuno.pid.2=0x0043
myuno.vid.3=0x2341
myuno.pid.3=0x0243

myuno.upload.tool=avrdude
myuno.upload.protocol=arduino
myuno.upload.maximum_size=32256
myuno.upload.maximum_data_size=2048
myuno.upload.speed=115200

myuno.bootloader.tool=avrdude
myuno.bootloader.low_fuses=0xFF
myuno.bootloader.high_fuses=0xDE
myuno.bootloader.extended_fuses=0xFD
myuno.bootloader.unlock_bits=0x3F
myuno.bootloader.lock_bits=0x0F
myuno.bootloader.file=optiboot/optiboot_atmega328.hex

myuno.build.mcu=atmega328p
myuno.build.f_cpu=16000000L
myuno.build.board=AVR_UNO
myuno.build.core=arduino:arduino
myuno.build.variant=standard
 

« Last Edit: Mar 23rd, 2018 at 12:11am by Tim@Visual Micro »  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: How to copy boards
Reply #6 - Mar 22nd, 2018 at 8:39pm
Print Post  
If I make a custom boards.txt how to I direct VM to use it instead of the default one?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to copy boards
Reply #7 - Mar 22nd, 2018 at 10:59pm
Print Post  
If you add a board to a new empty boards.txt in the location as I described that will be merged automatically into your boards list in visual micro and the arduino ide.

You do not need to copy an entire boards.txt, just clone a single board.

So you will find the sparkfun boards.txt and I think the architecture of your board is avr but when you see the boards.txt you will see the folder names which tell you the architecture.

When you find the sparkfun boards.txt just grab your board from it and rename as described into a new boards.txt

hope this makes sense?
  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: How to copy boards
Reply #8 - Mar 22nd, 2018 at 11:56pm
Print Post  
I followed your instructions, placed the file under Document\ArduinoHardware\MyBoards\avr, but I don't see the self defined board listed. I've attached the boards.txt. Maybe there is a syntax error in my file?
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to copy boards
Reply #9 - Mar 23rd, 2018 at 12:10am
Print Post  
Sorry typo in my path example

In the Arduino world your Arduino Sketch Book folder is usually "MyDocuments\Arduino"

The sketchbook folder is the folder that appears when you click "File>Open>Arduino Project".

Then below that folder you can can create a "\Libraries" folder and a "\Hardware" folder

Therefore the correct path is:-

MyDocuments\Arduino\Hardware\MyBoards\avr

  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: How to copy boards
Reply #10 - Mar 23rd, 2018 at 12:17am
Print Post  
Okay, thanks. MV found the board now but when I select it I get this error on the Output window:

There was an error locating the variants for this board:
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to copy boards
Reply #11 - Mar 23rd, 2018 at 12:34am
Print Post  
okay two possible solutions

change

jypromicro.build.variant=promicro

to 

jypromicro.build.variant=sparkfun:promicro

NOTE the sparkfun: has to match the name of the package folder above the original boards.txt. My example assumes it is called sparkfun but it's probably something else

OR

Option 2: Find the original boards.txt folder and you will see the \variants sub folder. copy the folder to below your boards.txt keeping the same structure as the original.

For option2 you would not add the sparkfun: prefix to jypromicro.build.variant
  
Back to top
IP Logged
 
level6
Junior Member
**
Offline


Posts: 18
Joined: Mar 21st, 2018
Re: How to copy boards
Reply #12 - Mar 23rd, 2018 at 1:23pm
Print Post  
Okay. I was able to get the custom boards.txt to load. The board now shows up in applications, like MIDI-OX, as a MIDI device with my custom name. Device Manager is still showing the hardware with the SparkFun Pro Micro name. I guess I need to upload different firmware to change the hardware name?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to copy boards
Reply #13 - Mar 23rd, 2018 at 1:36pm
Print Post  
Great well done.

Your next question is a little out of my domain and often differs depending on board.

You also need to be careful if you manage to change the device name or id then be sure the sparkfun tool chain will work okay with it.

Notice that in my earlier Uno example there are a variety of VID/PID combinations.

The VID/PID is used to establish the board in Visual Micro

myuno.vid.0=0x2341
myuno.pid.0=0x0043
myuno.vid.1=0x2341
myuno.pid.1=0x0001
myuno.vid.2=0x2A03
myuno.pid.2=0x0043
myuno.vid.3=0x2341
myuno.pid.3=0x0243

Some board defs also state a build.usb_product="SimpleMidiUSB" which is worth reading about to see if that can be used to change things.

Device Manager is a registry/wmi system which you could probably hack.
  
Back to top
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: How to copy boards
Reply #14 - Jul 16th, 2018 at 10:48am
Print Post  
Cloning the odroid_esp32 board to m5ow_esp32
I run into the same error:
There was an error locating the variants for this board: 
IMHO, critical strings are:
Code
Select All
odroid_esp32.name=ODROID ESP32

odroid_esp32.build.variant=odroid_esp32
odroid_esp32.build.board=ODROID_ESP32
 


Code
Select All
m5ow_esp32.name=M5OW ESP32

m5ow_esp32.build.variant=m5ow_esp32
m5ow_esp32.build.board=M5OW_ESP32
 



I also create M5ow folder in the variants folder with the same pins_arduino.h
« Last Edit: Jul 16th, 2018 at 10:49am by Kabron »  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: How to copy boards
Reply #15 - Jul 17th, 2018 at 2:05pm
Print Post  
Solved
variants folder name have to be the same as .build.variant name
in my case m5ow_esp32
« Last Edit: Jul 17th, 2018 at 2:06pm by Kabron »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint