Why there is no
__attribute__(( constructor )) void premain() {
init();
}
in last program?
Why there is no
__attribute__(( constructor )) void premain() {
init();
}
in last program?
Hi Anton,
Thank you for your work on the Discovery branch.
The last paragraph in the RCradioPWM program should be:
// Force init to be called *first*, i.e. before static object allocation.
// Otherwise, statically allocated objects that need libmaple may fail.
__attribute__(( constructor )) void premain() {
init();
}
int main(void) {
setup();
while (1) {
loop();
}
return 0;
}
I think it may be time to spin off a wiki page or blog for the LibMaple ~ Discovery somewhere if there is interest from forum readers.
Hi everybody.
Now ST released 'ST Link Utility V2.0'. It has 'ST-Link Utility Command Line Interface' (file ST-LINK_CLI.exe) to program binary file (.hex, .bin) to STM32 microcontroller.
I think modify Maple IDE to support command "Upload by ST-LINK UTILITY" now Maple IDE and Maple Library will using with STM32-VL Discovery board and all of board that used STM32 + ST-LINK Hardware.
Now we need to ask ST to compile version for Linux
& Mac OS-X some might hope
A Discovery wiki has been started at wiki.leaflabs.com under How To Guides.
I'm using snipt.net (didn't I do that to my dog?) to host source code with pretty formatting and keyword highlighting.
gbulmer, thank you for detailed analysis.
us *= 8;
provides the exact value.
The Discovery board and Anton's libmaple branch are flying in my tricopter.
Two lipo packs into flight testing so far... FUN!
http://snipt.net/ridgebackred/discoveryflyer001/
The thing I like best about writing code for things that fly is there is no doubt if something screws up. ;-) I've accumulated two hours or so of flight time on the code. No discernible glitches or crashes so far...
Anton, should I now use your discovery branch instead of the refactor branch?
So I'm not exactly sure how to use Anton's libmaple branch. At first I thought that it was a branch of the IDE (after comparing the source I'm pretty sure its not the entire IDE). How is it supposed to be used? Do I have to add the lines earlier in this post to the IDE files (e.g. boards). Can someone help me out. what do I do with Anton's libmaple branch?
Thanks.
ppeetteerr-http://wiki.leaflabs.com/index.php?title=Edit_sketches_with_Eclipse
Rename main.cpp.example to main.cpp to see if you can compile.
The line SerialUSB.println("Hello!");
needs to be commented out for the Discovery.
I put whatever program I'm working on in the same directory as main.cpp.example and rename it to main.cpp.
The discovery.bin file to upload will be found in the build directory.
ridgebackred, my copy of refactor has no discovery support, it was made just to pull i2c patch
Anton,
Thanks, I am still learning Github...
Are you able to read data from the wii nunchuk over i2c?
If yes, are you using 3V or 5V for power? External pullup resistors?
I read Nunchuk via WiiMP (clone versions from dealextreme.com) in pass-through mode, pover from 3.3V and do not use pullups.
http://wiibrew.org/wiki/Wiimote/Extension_Controllers
The sensors consume very little, so I should disconnect even serial cable to reset it.
I use similar code (add premain()):
https://github.com/anton19286/libmaple/blob/discovery/i2c.cpp
Anton, you fixed this already in the pre-refactor code... :-)
In HardwareSerial.cpp:
// TODO Put these magic numbers into boards.h #defines
HardwareSerial Serial1(USART1, TX1, RX1, 24000000UL); // was 72000000UL
HardwareSerial Serial2(USART2, TX2, RX2, 12000000UL); // was 36000000UL
HardwareSerial Serial3(USART3, TX3, RX3, 12000000UL); // was 36000000UL
You must log in to post.