Problem compling OpenChronos-ng

576 views
Skip to first unread message

Álvaro Martínez

unread,
Jul 19, 2013, 11:00:26 AM7/19/13
to openc...@googlegroups.com
Hello everyone.
It's the first time I try to install a new firmware to my EZ430 Chronos, and I don't know a lot of things about Linux, but I'm getting crazy trying to compile this.

After running a make config in my openchronos-ng-code path, I get this:


Generating dependencies..
makedepend: warning:  boot.c (reading openchronos.h, line 32): cannot find include file "msp430.h"
    not in ./msp430.h
    not in gcc/msp430.h
makedepend: warning:  boot.c (reading openchronos.h, line 34): cannot find include file "stdlib.h"
    not in ./stdlib.h
    not in gcc/stdlib.h
makedepend: warning:  drivers/display.c, line 58: cannot find include file "string.h"
    not in ./string.h
    not in gcc/string.h
makedepend: warning:  drivers/display.c, line 59: cannot find include file "stdlib.h"
    not in ./stdlib.h
    not in gcc/stdlib.h
makedepend: warning:  drivers/pmm.c, line 12: cannot find include file "cc430x613x.h"
    not in cc430x613x.h
    not in drivers/cc430x613x.h
    not in ./cc430x613x.h
    not in gcc/cc430x613x.h
makedepend: warning:  drivers/rtca.c, line 32: cannot find include file "stdlib.h"
    not in ./stdlib.h
    not in gcc/stdlib.h
makedepend: warning:  modules/otp.c, line 23: cannot find include file "string.h"
    not in ./string.h
    not in gcc/string.h
CC boot.c
CC modinit.c
CC openchronos.c
CC drivers/adc12.c
CC drivers/battery.c
CC drivers/buzzer.c
CC drivers/display.c
CC drivers/dsp.c
CC drivers/infomem.c
CC drivers/ports.c
CC drivers/radio.c
CC drivers/rf1a.c
CC drivers/rtca.c
CC drivers/rtc_dst.c
CC drivers/temperature.c
CC drivers/timer.c
CC drivers/vti_as.c
CC drivers/vti_ps.c
CC modules/accelerometer.c
CC modules/alarm.c
CC modules/battery.c
CC modules/clock.c
CC modules/music.c
CC modules/otp.c
CC modules/reset.c
CC modules/stopwatch.c
CC modules/temperature.c
CC modules/tide.c
-e
>> Building openchronos.elf as target RELEASE
modules/accelerometer.o: In function `acc_activated':
accelerometer.c:(.text.acc_activated+0x14): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x26): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x36): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x3a): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x3e): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x42): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x46): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x5e): undefined reference to `as_start'
accelerometer.c:(.text.acc_activated+0x62): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x74): undefined reference to `as_ok'
modules/accelerometer.o: In function `acc_deactivated':
accelerometer.c:(.text.acc_deactivated+0x24): undefined reference to `as_stop'
modules/accelerometer.o: In function `update_menu':
accelerometer.c:(.text.update_menu+0x1c): undefined reference to `as_config'
modules/accelerometer.o: In function `up_btn':
accelerometer.c:(.text.up_btn+0x1e): undefined reference to `as_config'
accelerometer.c:(.text.up_btn+0x2e): undefined reference to `as_config'
accelerometer.c:(.text.up_btn+0x32): undefined reference to `change_mode'
accelerometer.c:(.text.up_btn+0x3e): undefined reference to `as_read_register'
accelerometer.c:(.text.up_btn+0x4a): undefined reference to `as_status'
modules/accelerometer.o: In function `as_event':
accelerometer.c:(.text.as_event+0x1a): undefined reference to `as_stop'
accelerometer.c:(.text.as_event+0x28): undefined reference to `as_get_status'
accelerometer.c:(.text.as_event+0x2c): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x30): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x54): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x5c): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x6c): undefined reference to `as_get_data'
accelerometer.c:(.text.as_event+0x90): undefined reference to `as_read_register'
collect2 ld returned 1 exit status
make: *** [openchronos.elf] Error 1
root@alvaro-virtual-machine:/home/alvaro/openchronos-ng-code# make
-e
>> Building openchronos.elf as target RELEASE
modules/accelerometer.o: In function `acc_activated':
accelerometer.c:(.text.acc_activated+0x14): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x26): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x36): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x3a): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x3e): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x42): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x46): undefined reference to `as_config'
accelerometer.c:(.text.acc_activated+0x5e): undefined reference to `as_start'
accelerometer.c:(.text.acc_activated+0x62): undefined reference to `as_ok'
accelerometer.c:(.text.acc_activated+0x74): undefined reference to `as_ok'
modules/accelerometer.o: In function `acc_deactivated':
accelerometer.c:(.text.acc_deactivated+0x24): undefined reference to `as_stop'
modules/accelerometer.o: In function `update_menu':
accelerometer.c:(.text.update_menu+0x1c): undefined reference to `as_config'
modules/accelerometer.o: In function `up_btn':
accelerometer.c:(.text.up_btn+0x1e): undefined reference to `as_config'
accelerometer.c:(.text.up_btn+0x2e): undefined reference to `as_config'
accelerometer.c:(.text.up_btn+0x32): undefined reference to `change_mode'
accelerometer.c:(.text.up_btn+0x3e): undefined reference to `as_read_register'
accelerometer.c:(.text.up_btn+0x4a): undefined reference to `as_status'
modules/accelerometer.o: In function `as_event':
accelerometer.c:(.text.as_event+0x1a): undefined reference to `as_stop'
accelerometer.c:(.text.as_event+0x28): undefined reference to `as_get_status'
accelerometer.c:(.text.as_event+0x2c): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x30): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x54): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x5c): undefined reference to `as_status'
accelerometer.c:(.text.as_event+0x6c): undefined reference to `as_get_data'
accelerometer.c:(.text.as_event+0x90): undefined reference to `as_read_register'
collect2 ld returned 1 exit status
make: *** [openchronos.elf] Error 1


Could you help me please? Or just give me clue. I tried using Cygwin, using the deprecated mspgcc4 in a Ubuntu 10.04, and I just have lost count of how many different things I've tried  compiling this without any positive result :(

PS: I'm running Ubuntu 13.04 64bit right now.

Thanks!!

Álvaro Martínez

unread,
Jul 20, 2013, 7:51:10 AM7/20/13
to openc...@googlegroups.com
Sorry, but that error appears after running "make" NOT "make config"(make config works OK).
Thanks!

Álvaro Martínez

unread,
Jul 20, 2013, 9:15:53 AM7/20/13
to openc...@googlegroups.com
FIXED!!!
Just disable the Acceleration code.

Jeff

unread,
Nov 21, 2013, 7:36:38 PM11/21/13
to openc...@googlegroups.com
That's not really much of a fix though. I really want to use the accelerometer and am really disappointed it's not working. I'll be looking into this in the next couple of weeks. In the mean time, is there anyone out there who knows why we can't compile with the accelerometer module?

Thanks,
Jeff

Aljaž 'g5pw' Srebrnič

unread,
Nov 22, 2013, 3:23:52 AM11/22/13
to openc...@googlegroups.com, Jeff
Hello Jeff,
I’m one of the guys behing openchronos-ng. The answer to you question is, nobody ported that code to openchronos-ng yet.
--
You received this message because you are subscribed to the Google Groups "OpenChronos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openchronos...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-- 
Aljaž Srebrnič a.k.a g5pw
My public key:  http://bit.ly/g5pw_pubkey

Paolo Dev

unread,
Nov 22, 2013, 3:47:37 AM11/22/13
to openc...@googlegroups.com, openc...@googlegroups.com, Jeff
Apologies but I didn't follow the new releases in a while .
Can you send me the compilation error log?
I don't have time to install the tool on my new computer but can have a look in the meanwhile.

Sent from my iPad

Vitor Martins Augusto

unread,
Jan 2, 2014, 5:38:39 AM1/2/14
to openc...@googlegroups.com, Jeff
Hello,

I was lucky to get the Chrismas coupon from TI, so I now own a Chronos (v2 / white), too.

After some hickups I managed to compile the OpenChronos-ng sources and naturally I had to disable the acceleration module.

Is there any progress in porting this module? What is needed? I am a noob when it comes to programming outside my VB.net comfort zone, but I am willing to try.

Regards,
Vitor

Aljaž 'g5pw' Srebrnič

unread,
Jan 3, 2014, 5:13:25 PM1/3/14
to openc...@googlegroups.com, Vitor Martins Augusto, Jeff
Well, last I heard Paolo was working on it. There is some initial support, however, I have the old model and can’t test. AFAIK the module wasn’t fully ported for the old hardware, either.

Paolo Di Prodi

unread,
Jan 3, 2014, 5:39:20 PM1/3/14
to openc...@googlegroups.com, Vitor Martins Augusto, Jeff
Hello,
that is my new year resolution and I have a white model so I can do some work but cannot guarantee a time line!

Happy new year!

Dr. Paolo Di Prodi

Vitor Martins Augusto

unread,
Jan 3, 2014, 6:31:17 PM1/3/14
to Paolo Di Prodi, openc...@googlegroups.com, Jeff
Dear Paolo,

That's great news! Thank you for the feedback.

So far I managed to compile the CCS and IAR sources by TI, but IAR seems to be too limited in the free version, especially because it only produces *.d43 binary files which would have to be converted with FET-Pro430. Unfortunatly, at least one user reported that the *.txt file obtained this way, killed the watch. It seems that the output is not exactly the same as if obtained using CCS. I compared both files and they were not the same, indeed. What can happen is that the bootloader of the watch gets whiped by a bad *.txt file, i.e. when the start address is wrong.

I have managed to compile the sources of the openchronos-ng project, as well as two branches (Joachim Breitner and Richard Rondu) under Linux, using the Energia SDK package (just download and off you go).

Finally, I used Trandi's Hello World example to build a new module into the official TI source, using CCS. I changed it a bit in order to get my name and number, as well as,  wife and daughter's phone numbers (UP button will commute the scrolling text from 3 different names & numbers), in case I forget/loose my phone - this way the module is at least remotely useful.

All this happend during the last 1-2 days, so the learning curve was quite steep.

Unfortunatly, I realized how little I know about:

- Sourceforge or similar online colaborative projects
- C++
- Microcontroller
- CCS/IAR/GCC/etc.
- Structures/Object Programming/Types/etc.
- ...

I am able to read code and understand algorithms, I can edit the code and add conditions, cycles, loops, etc. But I would never have been able to pull the Hello World example out by myself. Even so, it was quite a feat to get it to work, as it is poorly explained (no critizism to Trandi meant - he did a great job!).

BUT: This is exactly the reason why I got the TI Chronos in first place: to learn something!

And yep: I tried combining the TI Chronos sources with the OpenChronos sources, to get the Bosch acceleration sensors to work, but did not succeed (obviously, some may say).

I did find something interesting, though: the only way I was able to compile the TI Chronos sources with the Hello World module, was to actually use the unrestricted setting. This means that the included binary driver seems to be different than the included, but excluded (when you select the limited version), driver.c files. Also, it means that the whole official firmware (including my extra module) does not exceed the limitation of the free CCS version.

I would love to have the bubble module from OpenChronos in the TI Chronos firmware, so that is what I will be looking at whenever I find some time.

I wish you all a great year!

Regards,
Vitor

Anthony Toft

unread,
Jan 14, 2014, 9:24:25 PM1/14/14
to openc...@googlegroups.com, Vitor Martins Augusto, Jeff

What is missing from the module for the old hardware? The errors I get are linker errors.

 

I have a module I am writing that will use the accelerometers, and I am hopeful that the problem is limited to getting the code to link, not an underlying problem with the actual functionality.

Paolo Di Prodi

unread,
Jan 15, 2014, 2:17:06 AM1/15/14
to openc...@googlegroups.com, Vitor Martins Augusto, Jeff
If I understood well your question is that there will be a functionality issue if you have the new white board chronos.
The problem I feared so far is that although the manufacturer of the accelerometer guarantees that the register structures are identical,
there might be different wait cycles to make it to work.

Anthony Toft

unread,
Jan 15, 2014, 6:30:13 AM1/15/14
to openc...@googlegroups.com
Thanks Paolo! The question I was asking was "if I fix the linker errors, will it work?" and it appears that the answer is "yes, for an older (black) watch, maybe for a newer (white) one" my ezchronos is 2-3 years old now, so I should be good to go.

I will track down the problem tonight and figure it out, I think it's related to the global variables as IIRC their use is very sensitive to the order in which the .o files are listed on the build line.

From: Paolo Di Prodi
Sent: ‎1/‎15/‎2014 2:17

Anthony Toft

unread,
Jan 19, 2014, 12:55:47 PM1/19/14
to openc...@googlegroups.com

Ok, I finally got some time to spend on this problem, and I found it…

 

“CONFIG_ACCELEROMETER” is not getting set when you turn on the accelerometer module (I suspect that “CONFIG_MOD_ACCELEROMETER” is defined) pretty much the entire vti_as.c file is in the #else clause of #ifndef CONFIG_ACCELEROMETER. CONFIG ACCELEROMETER is used in a few other places where there are references to the accelerometers.

 

Now, here is the problem as I see it…

 

I can change CONFIG_ACCELEROMETER to CONFIG_MOD_ACCELEROMETER and I think it will make this work for the accelerometer module. However, I don’t like the idea that for my new module to work I’d need to turn on the (kind of) unrelated accelerometer module. The question I have of the folks who made the build system, is there any way in the “.cfg” files for me to specify my module also needs to define a driver for its underlying functionality? If there isn’t, would it be useful to have such a system (I think so)

 

Let me know!

Aljaž 'g5pw' Srebrnič

unread,
Jan 21, 2014, 5:19:50 AM1/21/14
to openc...@googlegroups.com, Anthony Toft
Yes, the accelerometer module is not yet ported to the new build system, there was some work in progress (Paolo, was that you? Or was it Sean?). If anyone has patches, please submit them here or do a merge request on SF. I’ll merge as soon as I have time :)

Thanks,
Aljaž 

Anthony Toft

unread,
Jan 21, 2014, 7:24:47 AM1/21/14
to openc...@googlegroups.com
I had email from Paolo last week saying that on old hardware the accelerometer should work, I wanted to enable the accel module to confirm that before I tried to use it in my module. Which is when I figured out the problem, and then realized I would be unable to select the accel driver without also selecting the accel module.

It would be great if there was a way to put together someway to include exactly what  is needed

From: Aljaž 'g5pw' Srebrnič
Sent: ‎1/‎21/‎2014 5:20
To: openc...@googlegroups.com; Anthony Toft
[The entire original message is not included.]
Reply all
Reply to author
Forward
0 new messages