Thread Tools
This thread is privately moderated by Jack Crossfire, who may elect to delete unwanted replies.
Feb 20, 2013, 03:22 AM
Registered User
Jack Crossfire's Avatar
Thread OP
Discussion

More STM32F4 notes


Finally got I2C completely functional on the STM32F4. The problem is the example code needed to be rewritten to use state machine to be useful.

It checks for BUSY being true every time except after STOP. Then it checks for BUSY being false. Also, if it times out from a legitimate glitch, the necessary sequence is to DeInit & reinitialize it to get it to work again. You won't likely catch that nugget of information in your porting. That got it to the full 400khz, 1600 gyro samples, 400 accel samples, 120 mag samples.

Would say no-one else does this, but just relies on a preemptive OS & threading. Maybe they have the right idea in relying on threading. It's a lot of overhead. The college love affair with threading has been replaced by maximizing every clockcycle & the lowest latency possible.

Next, in true microcontroller fashion, letting the UART overflow crashes it, so you have an interrupt handler draining the UART. Writing to the flash prevents the UART interrupt handler from working & crashes it, so you need to disable all the UARTS before writing to the flash. Another nugget taken care of by an OS.

Anyways, during the process of STM32F4 debugging, it was amusing to look through the PX4 source code, finding it was written on the NuttX OS, which rewrote all the SDK functions from scratch, with their own deeply nested abstraction layer. It's the kind of dedication to the study of a single chip that you see from college students trying to prove they know all the intricacies of writing an abstraction layer, but realize is completely wasted effort after entering the workforce.

Then, there's the question of porting future robots to Arducopter. The problem is Arducopter itself is being restructured constantly, so porting to it is not really porting to anything for very long.


There are many autopilots & new ones constantly coming out. They're all incredibly stable, using the current generation of sensors. They're all competing for attention, all with new algorithms, by students hoping for a shot at getting hired into the space programs of the world. People don't even mention their autopilot unless it can hover in a 12cm box in 30mph wind. They're all based on different operating systems, different architectures, mostly on the STM32F4, but still a few on ATMega & PIC. More importantly, they've all appeared in the last 3 years.

These explosive phases of a new idea always end up in 1 very complex, comprehensive project becoming the dominant solution.

No-one brags about the STM32F4 in their sales pitches like they did about the ATMega, but it is the current jesus chip. The ATMega was a religion because it was the one when robotics got popular for the 1st time.
Last edited by Jack Crossfire; Feb 20, 2013 at 05:47 AM.
Sign up now
to remove ads between posts


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Open Hardware and Software : TMR-FC V1.0 ( based on stm32f4 ) cctsao1008 Multirotor Drone Electronics 18 Sep 08, 2013 10:55 PM
Australian's Note, Clearance sale 30-60% off on all GWS items & more. rck Aircraft - Electric - Airplanes (FS/W) 1 Sep 22, 2003 11:50 PM