![]() ![]() |
Feb 22 2008, 06:35 PM
Post
#21
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
hi... im very new to this NXT.. I have recently found out about this Lejos osek.. Actually im supposed to programme in Esterel programming language for my NXT, whihc in turns will churn out C.code (embedded c). I understadn that Lejos Osek can be used for embedded programming on NXT. I was wondering. are there any steps for me to follow?? I tried to install the applications with help from the website.. but i think i might hav miss out a step or 2... I'm kinda lost somewhere.. Actually what does the SAM-BA do? Thanks for your time for reading this... Sorry being sooo noob.. I am not sure about Esterel programming language and I found it by google Esterel for LEGO Mindstorms. Is this what you meant? If you had an ANSI C generator from Esterel, technically it is possible to run your C program on NXT by using LEJOS OSEK. LEJOS OSEK uses GCC, it should be no problem on any C program... I assume you already succeeded to build an executable from your Esterel generated C, it it right? SAM-BA is a program upload tool which is provided from ATMEL and it is used to upload a LEJOS OSEK program into the NXT. BTW, the next LEJOS OSEK V1.09 to be released soon and it will use LEGO MINDSTORMS NXT Driver instead of SAM-BA (it means that you can use NXT-G and LEJOS OSEK in a PC!), so if you don't mind, please wait for the new release. takashic |
|
|
|
Feb 22 2008, 10:39 PM
Post
#22
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 22-February 08 Member No.: 4,785 |
I am not sure about Esterel programming language and I found it by google Esterel for LEGO Mindstorms. Is this what you meant? If you had an ANSI C generator from Esterel, technically it is possible to run your C program on NXT by using LEJOS OSEK. LEJOS OSEK uses GCC, it should be no problem on any C program... I assume you already succeeded to build an executable from your Esterel generated C, it it right? SAM-BA is a program upload tool which is provided from ATMEL and it is used to upload a LEJOS OSEK program into the NXT. BTW, the next LEJOS OSEK V1.09 to be released soon and it will use LEGO MINDSTORMS NXT Driver instead of SAM-BA (it means that you can use NXT-G and LEJOS OSEK in a PC!), so if you don't mind, please wait for the new release. takashic Arh. May I ask about Sam-ba tool? Samba tool is just to upload the programme that I have compiled using the Cygwin (in bin file) ? Then I'm supposed to do is to let NXT go into firmware update mode, then switch on SAM-BA V2.6 to flash the ram.bin in? Err.. I'm supposed to finsih this project within 2 weeks time..hence i guess i have to make do with SAM-BA.. THanks for your help!!! |
|
|
|
Feb 24 2008, 12:24 AM
Post
#23
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Arh. May I ask about Sam-ba tool? Samba tool is just to upload the programme that I have compiled using the Cygwin (in bin file) ? Then I'm supposed to do is to let NXT go into firmware update mode, then switch on SAM-BA V2.6 to flash the ram.bin in? Err.. I'm supposed to finsih this project within 2 weeks time..hence i guess i have to make do with SAM-BA.. THanks for your help!!! Yes. SAM-BA is a program upload tool and you can upload a compiled C/C++ program with LEJOS OSEK to SRAM(not Flash) on the NXT. In the LEJOS OSEK distribution, there are many samples to help you to understand how to write a program and upload it. Takashic |
|
|
|
Feb 24 2008, 04:54 AM
Post
#24
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 22-February 08 Member No.: 4,785 |
Yes. SAM-BA is a program upload tool and you can upload a compiled C/C++ program with LEJOS OSEK to SRAM(not Flash) on the NXT. In the LEJOS OSEK distribution, there are many samples to help you to understand how to write a program and upload it. Takashic Oic! Thanks for your help on clarifying this.. I was puzzled with the usage of SAM-BA as i thought it is used to flash the firmware.. I will give it a try.. and update you with regards to this. Once again, thanks for your help!! Many good years ahead. |
|
|
|
Feb 24 2008, 01:46 PM
Post
#25
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 22-February 08 Member No.: 4,785 |
Oic! Thanks for your help on clarifying this.. I was puzzled with the usage of SAM-BA as i thought it is used to flash the firmware.. I will give it a try.. and update you with regards to this. Once again, thanks for your help!! Many good years ahead. Hi.. Need some help again.. I have just tried to upload the sample helloworld application .. It works. But i have a question. What does it mean for Lock Region(s) to lock? Does that mean that once i lock it ,i will not be able to reset it? Btw, one more last question. Does it mean that as long as I do not exit from the program, I will not be required to upload it again? Thanks so much. It is a relief to see that by using that NXT can be used with LEJOS OSEK (as well as our initial Esterel programming language). Many good years ahead! |
|
|
|
Feb 24 2008, 06:40 PM
Post
#26
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Hi.. Need some help again.. I have just tried to upload the sample helloworld application .. It works. But i have a question. What does it mean for Lock Region(s) to lock? Does that mean that once i lock it ,i will not be able to reset it? Btw, one more last question. Does it mean that as long as I do not exit from the program, I will not be required to upload it again? Thanks so much. It is a relief to see that by using that NXT can be used with LEJOS OSEK (as well as our initial Esterel programming language). Many good years ahead! Sounds nice!. Concerning your question about Flash Lock regions, AT91SAM7S256 in the NXT has some lock swith to keep the program in the Flash and you need to take care of the life cycle of the Flash. So in case of LEJOS OSEK, the program is uploaded into SRAM (not Flash) intentionally. As long as you upload a program into SRAM, you don't need to worry about it. In hello world sample, the program is uploaded by the following tcl script: send_file {SRAM} "C:/cygwin/lejos_osek/samples/HelloWorld/helloworld_samba_ram.bin" 0x202000 0 go 0x202000 - 0x202000 address is in SRAM (not Flash). Concerning the second question. If you wanted to re-start the program, push STOP button and your program is re-booted. So you don't need to upload the program as long as you don't push EXIT button to make the NXT sleep. P.S. you mentioned that you have a project to create a NXTway like robot. Under samples directory, there is NXTway-GS example. the C code in NXTway-GS is also not human written code, but it is generated by Simulink. takashic |
|
|
|
Feb 24 2008, 10:29 PM
Post
#27
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 22-February 08 Member No.: 4,785 |
Sounds nice!. Concerning your question about Flash Lock regions, AT91SAM7S256 in the NXT has some lock swith to keep the program in the Flash and you need to take care of the life cycle of the Flash. So in case of LEJOS OSEK, the program is uploaded into SRAM (not Flash) intentionally. As long as you upload a program into SRAM, you don't need to worry about it. In hello world sample, the program is uploaded by the following tcl script: send_file {SRAM} "C:/cygwin/lejos_osek/samples/HelloWorld/helloworld_samba_ram.bin" 0x202000 0 go 0x202000 - 0x202000 address is in SRAM (not Flash). Concerning the second question. If you wanted to re-start the program, push STOP button and your program is re-booted. So you don't need to upload the program as long as you don't push EXIT button to make the NXT sleep. P.S. you mentioned that you have a project to create a NXTway like robot. Under samples directory, there is NXTway-GS example. the C code in NXTway-GS is also not human written code, but it is generated by Simulink. takashic Heh So the option for me to Lock Region(s) is not necessary right? Hokays! Also, once I exit the NXT, i will have to upload the program again right? But how it is possible that the program stays inside NXT for so long unless I keep it with the battery/electricity? Thanks takashic, especially for your patience! Cheers. |
|
|
|
Feb 24 2008, 11:57 PM
Post
#28
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Heh So the option for me to Lock Region(s) is not necessary right? Hokays! Also, once I exit the NXT, i will have to upload the program again right? But how it is possible that the program stays inside NXT for so long unless I keep it with the battery/electricity? Thanks takashic, especially for your patience! Cheers. You are right. Unfortunately, there is no way to keep the program in SRAM if you removed the battery so you need to re-upload the program to the NXT. takashic |
|
|
|
Feb 26 2008, 08:05 PM
Post
#29
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Hi,
LEJOS OSEK V1.09 is released now. What's new is this release is: - Use libNXT(libUSB) and LEGO MINDSTORMS NXT Driver instead of ATMEL SAM-BA to upload a program. This change makes user can use NXT-G, leJOS NXJ and LEJOS OSEK in a PC - Refactored LEJOS OSEK base code LEJOS OSEK Website is also updated with detailed descriptions. Enjoy! takashic |
|
|
|
Mar 5 2008, 01:27 PM
Post
#30
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 29-February 08 Member No.: 4,835 |
Hello everyone!
I'm new here in this forum... I'm new in embedded systems development and in Lego Mindstorms, after all... For my university stage & thesis I'm going to work with NXT, and now I'm studying how Lejos OSEK works. Since I'm a GNU/Linux user I'm doing the best efforts in order to get the system work under this platform. First thing: - Use libNXT(libUSB) and LEGO MINDSTORMS NXT Driver instead of ATMEL SAM-BA to upload a program. This change makes user can use NXT-G, leJOS NXJ and LEJOS OSEK in a PC I'd like to let you know that the program has been originally written for posix systems, so it works under GNU/Linux too. The source code can be retrieved by downloading the Lejos tarball, and requires scons + libusb. Second thing: The Lejos OSEK kernel is (as the name suggests) OSEK compliant. The OIL implementation file is parsed by SG.EXE, that works well under GNU/Linux too (by using wine), but it's a mere binary file. I'd like to know if the source code of this program is distributed as free software, or if there's a free software implementation of it. Thanks in advance. Giovanni Simoni |
|
|
|
Mar 6 2008, 02:18 AM
Post
#31
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 29-February 08 Member No.: 4,835 |
First thing: I'd like to let you know that the program has been originally written for posix systems, so it works under GNU/Linux too. The source code can be retrieved by downloading the Lejos tarball, and requires scons + libusb. Ooops... I've noticed that the source code of libnxt is also included in Lejos OSEK tarball! |
|
|
|
Mar 8 2008, 12:15 PM
Post
#32
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Hello everyone! I'm new here in this forum... I'm new in embedded systems development and in Lego Mindstorms, after all... For my university stage & thesis I'm going to work with NXT, and now I'm studying how Lejos OSEK works. Since I'm a GNU/Linux user I'm doing the best efforts in order to get the system work under this platform. First thing: I'd like to let you know that the program has been originally written for posix systems, so it works under GNU/Linux too. The source code can be retrieved by downloading the Lejos tarball, and requires scons + libusb. Second thing: The Lejos OSEK kernel is (as the name suggests) OSEK compliant. The OIL implementation file is parsed by SG.EXE, that works well under GNU/Linux too (by using wine), but it's a mere binary file. I'd like to know if the source code of this program is distributed as free software, or if there's a free software implementation of it. Thanks in advance. Giovanni Simoni Hi Jonny5, Thank you for your great work on LEJOS OSEK! Unfortunately, I dont't have Linux machine, so no way to test it. However, definitely a good thing to make people have more choices of environments to play with LEJOS OSEK. Concerning TOPPERS OSEK SG.exe, As you pointed, so far no source code is available. I also am not sure why?, however TOPPERS said (in Japanese), their OSEK is still on going, so they hesitated to release the code which may be changed. If you were OK, I would like to set a link to Lejos tarball. Thanks, Takashi |
|
|
|
Mar 8 2008, 12:58 PM
Post
#33
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 29-February 08 Member No.: 4,835 |
Thank you for your great work on LEJOS OSEK! Genuinely I haven't done any tangible work at all! I'm just studying code and running some tests ... Concerning TOPPERS OSEK SG.exe, As you pointed, so far no source code is available. I also am not sure why?, however TOPPERS said (in Japanese), their OSEK is still on going, so they hesitated to release the code which may be changed. Ok... this make thing harder... but thanks for the information. If you were OK, I would like to set a link to Lejos tarball. Actually I think I'm not the right guy to be asked for this. I'm not yet an active developer: I'm still in larval stage!! Surely the relationship between Lejos and Lejos OSEK makes this another good point of star for everyone that wants to hack into Lejos OSEK... so, why not? Regards Giovanni |
|
|
|
Mar 12 2008, 01:39 PM
Post
#34
|
|
|
Newbie ![]() Group: Members Posts: 9 Joined: 29-February 08 Member No.: 4,835 |
Hi Jonny5, Thank you for your great work on LEJOS OSEK! Concerning TOPPERS OSEK SG.exe, As you pointed, so far no source code is available. I also am not sure why?, however TOPPERS said (in Japanese), their OSEK is still on going, so they hesitated to release the code which may be changed. Last news about SG.exe: my new objective is replacing SG.exe with a free-software OIL parser. Now the facts: On the OSEK specification papers I've found OIL grammar: it should be regulated in order to get an equivalent but smarter one. No Problema! I've tacked on a simple lexer and a parser structure written in C (i've used bison as parser generator). Within next week I'll publish some details on my blog. Everyone who wants to cooperate with me is welcome. Giovanni |
|
|
|
Mar 12 2008, 06:30 PM
Post
#35
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
Last news about SG.exe: my new objective is replacing SG.exe with a free-software OIL parser. Now the facts: On the OSEK specification papers I've found OIL grammar: it should be regulated in order to get an equivalent but smarter one. No Problema! I've tacked on a simple lexer and a parser structure written in C (i've used bison as parser generator). Within next week I'll publish some details on my blog. Everyone who wants to cooperate with me is welcome. Giovanni It is always exciting to see the things are getting better through open source project. On my side, I have been trying to implement flash loader on LEJOS OSEK. It means that application program will be uploaded into Flash in safe way such as LEGO/leJOS NXJ does. So more than 200kbytes Flash and 50-60 kbytes SRAM will be available for user program! It will not be released soon because I need to check a lot of things (I just confirmed it works), so please be patient. Takashi |
|
|
|
Apr 9 2008, 09:34 AM
Post
#36
|
|
|
Newbie ![]() Group: Members Posts: 4 Joined: 9-April 08 From: Netherlands Member No.: 5,059 |
I am trying to make a wireless sensor network using the NXT and Lejos Osek. For that I need all my bricks to be able to communicate with each other (using Bluetooth) but as far as I can figure out, one brick can only have a Bluetooth connection with one other brick at a time. If I understand correctly it should be able to create a new Bluetooth connection at runtime, though I still have to figure out how, but I was wondering why multiple connections are not supported. Are there any plans to implement that?
I am currently using Lejos Osek v1.09, but if I'm correct the latest versions didn't bring any Bluetooth changes. Greets, Tubyhes |
|
|
|
Apr 9 2008, 07:04 PM
Post
#37
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
I am trying to make a wireless sensor network using the NXT and Lejos Osek. For that I need all my bricks to be able to communicate with each other (using Bluetooth) but as far as I can figure out, one brick can only have a Bluetooth connection with one other brick at a time. If I understand correctly it should be able to create a new Bluetooth connection at runtime, though I still have to figure out how, but I was wondering why multiple connections are not supported. Are there any plans to implement that? I am currently using Lejos Osek v1.09, but if I'm correct the latest versions didn't bring any Bluetooth changes. Greets, Tubyhes Your understanding is correct. Currently, LEJOS OSEK supports only one NXT to one NXT Bluetooth communication. I know NXT supports multiple NXT communications via Bluetooth (max 3 NXT?), however I haven't implemented this feature yet. Thanks, I could find a To Do, I will try it! Takashic |
|
|
|
May 1 2008, 06:31 PM
Post
#38
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 140 Joined: 3-October 06 Member No.: 303 |
This must be a silly question, but still...
I compiled helloworld of version 2.00, and tried to download helloworld_app_rom.bin to the NXT. I changed the file name from .bin to .rfw and used the NXT-G upload firmware command to upload it. It reported that the download is complete, but the brick just keeps clicking, even after I took the battery out and put it back in. Is there a different way to upload binaries using NXT-G? (Some explanation: I also tried a couple of days ago the method that explained on the web site, but SAM-BA does not seem to work on Vista, and libusb registered itself as a driver to all my devices, including the WiFi card, so I really prefer to avoid it). Thanks, Sivan |
|
|
|
May 1 2008, 07:47 PM
Post
#39
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 136 Joined: 7-October 07 Member No.: 4,012 |
This must be a silly question, but still... I compiled helloworld of version 2.00, and tried to download helloworld_app_rom.bin to the NXT. I changed the file name from .bin to .rfw and used the NXT-G upload firmware command to upload it. It reported that the download is complete, but the brick just keeps clicking, even after I took the battery out and put it back in. Is there a different way to upload binaries using NXT-G? (Some explanation: I also tried a couple of days ago the method that explained on the web site, but SAM-BA does not seem to work on Vista, and libusb registered itself as a driver to all my devices, including the WiFi card, so I really prefer to avoid it). Thanks, Sivan As you said, unfortunately, it does not work. nxtOSEK (ex. LEJOS OSEK) application upload is assumed to be done by appflash.exe with NXT BIOS. Concerning Vista issue with libUsb for win32, I have never tested it. However, leJOS NXJ users also have encountered the same issue and I found several forums at leJOS forum: http://lejos.sourceforge.net/forum/viewtopic.php?t=541 http://lejos.sourceforge.net/forum/viewtopic.php?t=872 Some peple seem to find a solution to make libUsb run on Vista, but there seems to be a lot of troubles... Takashic |
|
|
|
May 1 2008, 07:50 PM
Post
#40
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 140 Joined: 3-October 06 Member No.: 303 |
As you said, unfortunately, it does not work. nxtOSEK (ex. LEJOS OSEK) application upload is assumed to be done by appflash.exe with NXT BIOS. Concerning Vista issue with libUsb for win32, I have never tested it. However, leJOS NXJ users also have encountered the same issue and I found several forums at leJOS forum: http://lejos.sourceforge.net/forum/viewtopic.php?t=541 http://lejos.sourceforge.net/forum/viewtopic.php?t=872 Some peple seem to find a solution to make libUsb run on Vista, but there seems to be a lot of troubles... Takashic Thanks a lot. Do you know why NXT-G cannot upload an AT91 binary program? Doesn't it simply upload a binary image to the beginning of the flash? In other words, what is special about the Lego .rfw files? |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 9th February 2010 - 04:45 PM |