Process of building an Airplane Engine monitor. It will connect a Arduino to an Android phone or Tablet.
Showing posts with label Discovery F3. Show all posts
Showing posts with label Discovery F3. Show all posts
Tuesday, January 22, 2013
more stm discovery f3 links
STM has a repository of sample code for the discovery board. I need that for finding out how to make calls. I am more of a monkey see, monkey do kind of programmer. I'll use the manual if I have a question about a call, or can't find and example. I find it faster to find some code that mostly does what I need, and adapt it (reuse!). Most of the ST site is full of javascript pop ups that probably work on other browsers, but on Mandriva running Linux, the popups get lost, and make navigation complex (probably windows would be similar, but I am not going to try to find out. The manual is a PDF file, which is fine, I can download that and have a copy any time I need it. Some of the confusion too is all the devices that you can get data for.
The example code includes code for the on chip peripherals, not so much for the off chip items like the accelerometer, compass and gyro. I'll still have to dig for that.
Then of course, yesterday hack-a-day had a template for setting up discovery board projeccts. I'll have to look at it now, since I have a link to it. He has something similar to code bench but for gcc-arm-embedded toolchain. That is good. I should be able to follow some of that work and get some ideas.
On my facebook post, I suggested I was building an autopilot. This can be the hub of various peripherals, including the autopilot. Unless one gets a direct route, the heading might not matter, but the IMU should allow guidance point to point, as good or better than the GPS.
News on the JXD S5110 front...
My son has tuned in to the whole retro gaming with game pad buttons. He is probably playing the game as much, or more than he was before (that is good and bad). I spent some time with it also, when he wasn't around. The OTG port was just sitting there, and I finally got around to plugging a mouse into the port. It worked! so if he gets bored with the retro games, he can plug a mouse into it, and use it like a touch screen. The usability is going up! I won't show him the HDMI port, or he'll probably want to play all his games on the big screen.
More people are following, so tell your friends!
good luck
Saturday, January 19, 2013
Discovery Board is Working
Last week, I got the compiler compiling code. This week I got the discovery board talking OpenOCD. Life is good, now I just gotta figure out a protocol for sending data back up the USB port.
The engine monitor is on the back burner again. I want to build an IMU, since I have this board. If I can build an IMU, I should be able to build a little glass cockpit type display, similar to the Dynon or other EFIS app for the Android. The discovery board doesn't have any pressure sensors, but has a 3 axis gyro, a compass, 3D accelerometer, and a bunch of LEDs.
Using the gyro's, compass and accelerometers I should be able to build an accurate atitude indicator, a turn coordinator, a directional gyro indicator. If I can add pressure sensors, I should be able to build the whole "6-pack" from a standard instrument panel.
The secret to OpenOCD was at this site. Don't build the ftdi stuff, unless you have the ftdi dongle. If you are talking to the Discovery board, all you need is "stlink" that has been in OpenOCD since version 6.1.
The open pilot site has some resources for the discovery f3. There is a quad copter built using one.
Life is funny sometimes. Telnet, something I rely on, it is just there on all systems, old DOS (with some network kit), windows, all the unix systems I've used, mac and linux. For some reason, it isn't part of the default installation of Mandriva linux. How does one do anything without telnet. A simple urpmi and I have it, but weird!!
Anyway, I don't know if I added a link to this page, but it has a very high level set of instructions for building and loading software on the board, including using OpenOCD. He does:
I havn't figured out what offset to write the image yet. There is another version of write:
byte offset from the beginning of the bank.
I think that will be something to play with in the future. The test_image shows it at 0x0800000, which may have been a typo from the initial site.
The JXD S5110...
Well, it lived a hard life. It isn't dead, but well on the way. Today it was dropped, and the screen broke. This seems to have rendered the touch screen completely useless. I cannot figure out how to make the touch screen usable. The emulated games to work though. They mostly relied on the buttons around the screen, and they still work! The buttons emulate certain screen inputs, so you can unlock the device, and navigate the icons to select the games. It is funny, you know it is android, and you want to touch it, but that doesn't work. The joystick on the side does most of the driving, and the select button selects things. If someone made a good bumper for it, I'd probably buy another one.
Keep building
The engine monitor is on the back burner again. I want to build an IMU, since I have this board. If I can build an IMU, I should be able to build a little glass cockpit type display, similar to the Dynon or other EFIS app for the Android. The discovery board doesn't have any pressure sensors, but has a 3 axis gyro, a compass, 3D accelerometer, and a bunch of LEDs.
Using the gyro's, compass and accelerometers I should be able to build an accurate atitude indicator, a turn coordinator, a directional gyro indicator. If I can add pressure sensors, I should be able to build the whole "6-pack" from a standard instrument panel.
The secret to OpenOCD was at this site. Don't build the ftdi stuff, unless you have the ftdi dongle. If you are talking to the Discovery board, all you need is "stlink" that has been in OpenOCD since version 6.1.
The open pilot site has some resources for the discovery f3. There is a quad copter built using one.
Life is funny sometimes. Telnet, something I rely on, it is just there on all systems, old DOS (with some network kit), windows, all the unix systems I've used, mac and linux. For some reason, it isn't part of the default installation of Mandriva linux. How does one do anything without telnet. A simple urpmi and I have it, but weird!!
Anyway, I don't know if I added a link to this page, but it has a very high level set of instructions for building and loading software on the board, including using OpenOCD. He does:
openocd -f /usr/local/share/openocd/scripts/board/stm32f3discovery.cfg & telnet localhost 4444 reset halt flash erase_sectors 0 0 127 flash write a.out 0x8000000
To make that work, you really need to use the '&' to put open OCD in the background or use another terminal to do the telnet. Then you need to use different commands (maybe he had another version):
openocd -f /usr/local/share/openocd/scripts/board/stm32f3discovery.cfg & telnet localhost 4444 reset halt flash erase_sector 0 0 127 flash write_image imu.elf
I havn't figured out what offset to write the image yet. There is another version of write:
flash write_bank bank_id filename offsetWrite binary data from file to flash bank, starting at specified
byte offset from the beginning of the bank.
I think that will be something to play with in the future. The test_image shows it at 0x0800000, which may have been a typo from the initial site.
test_image imu.elf address 0x08000000 length 0x000004cc address 0x080004cc length 0x00000028 verified 1268 bytes in 0.000318s (3893.966 KiB/s)The darn GDB doesn't work though. It was built expecting libncurses.so.4, and I only have that version in /usr/lib64. I'll probably have to build that too, now. The demo code only increments a value by 5. Probably keeps the CPU pretty busy! Good way to test the debugger once I get that running.
The JXD S5110...
Well, it lived a hard life. It isn't dead, but well on the way. Today it was dropped, and the screen broke. This seems to have rendered the touch screen completely useless. I cannot figure out how to make the touch screen usable. The emulated games to work though. They mostly relied on the buttons around the screen, and they still work! The buttons emulate certain screen inputs, so you can unlock the device, and navigate the icons to select the games. It is funny, you know it is android, and you want to touch it, but that doesn't work. The joystick on the side does most of the driving, and the select button selects things. If someone made a good bumper for it, I'd probably buy another one.
Keep building
Labels:
Android,
Discovery F3,
EFIS,
GCC,
IMU,
JXD S5110,
OpenOCD,
OpenPilot,
Quad Copter,
STM
Subscribe to:
Posts (Atom)