user@~$ sudo apt-get install git cmake gcc-arm-none-eabi user@~$ git clone https://github.com/stawel/cheali-charger.git user@~$ cd cheali-charger user@~/cheali-charger$ ./bootstrap-arm user@~/cheali-charger$ make
user@~$ sudo apt-get install cmake avrdude avr-libc gcc-avr git
user@~/cheali-charger$ ./bootstrap-arm user@~/cheali-charger$ make
with reference to https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
After that I had second problem. It still not compile because some header files are missing.
Package gcc-arm-none-eabi from standard Ubuntu repository is not OK or probably it need another packages with headers.
Solution for this problem i found here: https://github.com/stawel/cheali-charger/blob/master/arm-compiler.cmake#L3
!!! If you are using Ubuntu 14.04 and later, please be careful because there are packages with same name but produced by Debian and inherited by Ubuntu. Simply follow the above 3 steps, you may end up with gcc-arm-none-eabi from Ubuntu. So to install gcc-arm-none-eabi from ARM, steps are:When finished with this removal/installation I finally compiled arm version on Linux.
1). sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi2). sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
3). sudo apt-get update
4). sudo apt-get install gcc-arm-none-eabi=4.9.3.2014q4-0trusty12
or
sudo apt-get install gcc-arm-none-eabi=4.9.3.2014q4-0utopic12
user@~$ sudo apt-get remove gcc-arm-none-eabi
I saw that you submitted patch to OpenOCD http://openocd.zylin.com/#/c/2426/
Did you successfully erase flash reset config registers?
Last night i decided to setup cheali-charger development environment on Linux.
... CMakeLists.txt it writen with assumption that avr compiler is alredy instaled.
After that I had second problem. It still not compile because some header files are missing.
Package gcc-arm-none-eabi from standard Ubuntu repository is not OK or probably it need another packages with headers.
gcc-version text data bss dec hex
4.9.3.2014q4 32420 1120 3916 37456 9250
4-8-2014q2-0 31964 1120 3916 37000 9088
TODO:
- It seems to me that on site http://gnuarmeclipse.livius.net/blog/toolchain-install/ we can find all information necessary to build Eclipse based development environment for ARM. Probably I will tray to install something similar on my VMware LUbuntu image. Does somebody try to build GNU ARM Eclipse according this site?
- Try to build OpenOCD for ST-linkV2 with Pawel patch for M051x. Pawel do you have any suggestions regarding this build?
I've made a branch on github with the patch: https://github.com/stawel/openocdhmm... I don't remember all dependencies :/ probably it was:$ sudo apt-get install build-essential autoconf automake libtool libusb-1.0-0-dev
$ cd openocdopenocd$ ./bootstrapopenocd$ ./configureafter that you should see:..ST-Link JTAG Programmer yes (auto)openocd$ makeopenocd$ sudo make installrunning openocd:openocd$ sudo cp contrib/99-openocd.rules to /etc/udev/rules.d/openocd$ openocd -f interface/stlink-v2.cfg -f target/m051.cfgif everything is ok, you can connect to openocd through telnet:(run in another console)$ telnet localhost 4444
I compiled openocd. When connect with telnet it seems that everything is fine but when start progStLink.sh it start but newer finish. Maybe problem with VMware or something else. Now it is to late to investigate and try manually flash firmware.
Before tray to flas firmware I play with some commands you mention.
Any suggestions?
Dana ponedjeljak, 15. prosinca 2014. 13:48:07 UTC+1, korisnik cheali-charger napisao je:...adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : clock speed 1000 kHz
Info : STLINK v2 JTAG v19 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.512157
Info : m051.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
Info : device id = 0x10005a00
Info : device name = M0516LBN
Info : bank base = 0x00000000, size = 0x00010000
looks like some write problems,I had something similar, I've changed the Vdd to 5V andsuddenly everything began to work.
gcc-version text data bss dec hex
4.9.3.2014q4 32420 1120 3916 37456 9250
4-8-2014q2-0 31964 1120 3916 37000 9088interesting
CooCox CoIDE successfully flash my M0517 over ST-Link V2.
Vcc voltage can be connect to 5V or 3.3V. Flashing work, but LCD display is not visible when Vcc is connected on 3.3V so I usually Vcc connect to 5V pin of my ST-Link V2.
I have no idea what's going on in OpenOCD, maybe it's the VMware, but on the other hand,chip erase and read works so it's probably not that.
you could try to reproduce the "program" command by hand in telnet,a simplified version would look like this (write only 4 bytes):> halt> flash probe 0> mini51 read_isp 0x00x0000000: 0xffffffff> mini51 write_isp 0x0 0x12345678> mini51 read_isp 0x00x0000000: 0x12345678(check if erase works)>flash erase_sector 0 0 1> mini51 read_isp 0x00x0000000: 0xffffffffhmm... also the ./progStLink.sh takes a while (~1min) maybe you are terminating it too early?
> halt> flash probe 0> mini51 read_isp 0x00x0000000: 0xffffffff> mini51 write_isp 0x0 0x12345678> mini51 read_isp 0x00x0000000: 0x12345678(check if erase works)>flash erase_sector 0 0 1> mini51 read_isp 0x00x0000000: 0xffffffff
Today I compile cheali-charger & openOCD on real Ubuntu Linux 14.04. Unfortunately I have identical behaviour as on LUbuntu on VMware under XP.
Could you try with your programer/debugger:
> debug_level 3
debug_level: 3
> mini51 read_isp 0x0
0x00000000: 0x00000670
> mini51 write_isp 0x0 0x12345678
0x00000000: 0x12345678
> mini51 read_isp 0x0
0x00000000: 0x00000670
./progStLink.sh works but write is very, very slow.
wrote 34304 bytes from file cheali-charger-imaxB6-clone_0.99-20141222_nuvoton-M0517.hex in 209.095047s (0.160 KiB/s)
Dana ponedjeljak, 22. prosinca 2014. 13:06:47 UTC+1, korisnik cheali-charger napisao je:2014-12-22 2:16 GMT+01:00 sasam <sasa.mi...@gmail.com>:./progStLink.sh works but write is very, very slow.
wrote 34304 bytes from file cheali-charger-imaxB6-clone_0.99-20141222_nuvoton-M0517.hex in 209.095047s (0.160 KiB/s)
Probably i don't undestand how process of write/read to flash memory work, and i am prety confused with OpenOCD debug log for write or read operation.
Not according to this site, but I'm using eclipse, you need to:1 .run cmake with the "./bootstrap-arm" command2. in eclipse: "File"->"Import"->"General"->"Existing Project into Workspace"3. set: "Select root directory" to your cheali-charger directory, and "Finish"if you need debugging (patched OpenOCD needed):5. additionally to "OpenOCD plug-in usage":- in "Debugger"->"OpenOCD setup"->"other options" set to: "-f interface/stlink-v2.cfg -f target/m051.cfg"- in "Debugger"->"GDB client setup"->"executable:" set to "/usr/bin/arm-none-eabi-gdb"