eVic SDK is a software development kit for writing APROMs for the Joyetech eVic VTC Mini.
-
You need to setup an arm-none-eabi GCC toolchain and newlib. On Fedora, install the following packages:
arm-none-eabi-gcc arm-none-eabi-newlibOn Ubuntu, the following packages should be enough:
gcc-arm-none-eabi libnewlib-arm-none-eabiI only tested it on Fedora at the moment, but there shouldn't be issues with other distros. In case the precompiled packages aren't available for you distro, you may have to compile it yourself. I still haven't tested it on Windows.
-
Setup python-evic.
-
Clone this repository:
git clone https://github.com/ReservedField/evic-sdk.git cd evic-sdk -
Download the latest M451 series SDK from Nuvoton and copy the
Libraryfolder insideevic-sdk/nuvoton-sdk, as to haveevic-sdk/nuvoton-sdk/Library. -
Point the
EVICSDKenvironment variable to theevic-sdkfolder. Tipically, you'll add this to your.bashrcfile in your home directory:export EVICSDK=/path/to/evic-sdkMake sure to restart your terminal to ensure the variable is set before building.
-
Build the SDK:
make
-
Installing under windows is almost the same as under linux machine. You need cygwin, make for windows and gcc-arm toolchain installed and added to path (so you can call
makeandarm-none-eabi-gccfrom the command line). Although having cygwin in your path is necessary you don't (and probably shouldn't) run it under bash. Windows commandline is okay. -
Setup python-evic (Again, you need to be able to run
evicfrom anywhere in cmd). -
Clone this repository:
git clone https://github.com/ReservedField/evic-sdk.git cd evic-sdk -
Download the latest M451 series SDK from Nuvoton and copy the
Libraryfolder insideevic-sdk/nuvoton-sdk, as to haveevic-sdk/nuvoton-sdk/Library. -
Set
EVICSKDto point to your sdk location using forward slashes (this is very important), so it looks like this:SET EVICSDK=C:/evic-sdk -
You will also need to set
ARMGCCvariable poining to arm-none-eabi install location likeSET ARMGCC=D:/arm-none-eabi. The folder you point to should containbin,libandarm-none-eabifolders. Again, remember about forward slashes. -
Build the sdk with
make.
At this point, the SDK should be fully set up. You can also generate Doxygen documentation with:
make docs
To clean up the build (for example if you want to do a full rebuild), use the standard:
make clean
The helloworld example should be the first thing you try compiling and flashing,
to check that everything is working correctly.
Building is as easy as:
cd example/helloworld
make
To clean you can use make clean, as usual.
If the build succeeds, you should now have a bin/helloworld.bin file ready to flash.
This file is encrypted and compatible with the official updater.
You can also generate a unencrypted binary:
make helloworld_unencrypted.bin
You can flash the output binary using the official updater. For development,
using python-evic is quicker and simpler.
I suggest to backup your dataflash before flashing, in case anything goes south:
evic dump-dataflash -o data.bin
Now, flash:
evic upload bin/helloworld.bin
If everything went well you should see the "Hello, World." message.
This APROM doesn't include USB updating, so you need to reboot to LDROM to flash something else. To do it, remove the battery and disconnect the USB cable. Then, holding the right button, connect the USB cable. Now you can let the button go and flash away. You can also insert the battery while the button is pressed, then let it go and connect the cable. I find powering over USB is more convenient (as long as the APROM doesn't require significant power, i.e. it doesn't fire the atomizer). Similiarly, holding the left button during powerup will force the system to boot from APROM.
If python-evic fails and the eVic won't flash back to a functioning state, don't panic.
Find a Windows/Mac machine (or virtualize one), boot the eVic to LDROM and flash an original
firmware using the official Joyetech updater. It has always worked for me.
Unless you're messing with the LDROM, this is practically unbrickable - you can always boot to LDROM and restore. Actually, APROM update is always done from LDROM - the official firmware doesn't even contain flash writing routines, it only provides access to the dataflash and the actual APROM upload happens in LDROM after a reset.
The SDK provides a working CDC-compliant USB virtual COM port driver. This allows you to
communicate with a computer for debugging purposes. On Linux and Mac it's plug-and-play. On
Windows, you have to create an INF file with the virtual COM VID/PID pair to get it to install
the driver. An example can be found in the Nuvoton SDK, under SampleCode/StdDriver/USBD_VCOM_ SinglePort/Windows Driver.
An example on how to use the port is given in example/usbdebug. You can communicate with it
using your favorite serial port terminal. All the line coding parameters (baud rate, parity,
stop bits, data bits) are ignored, so you don't need to worry about them.
There are a few caveats, which will be fixed soon:
- At most 63 bytes can be transferred at a time.
- Host-to-device communication is not implemented yet (you can't receive data).