Naze32Pro STMF3 help thread

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Naze32Pro STMF3 help thread

Post by jihlein »

Guess I'm confused (it's been that kind of a day...). Code shows PA9/PA10:

Code: Select all

#define I2C1_SCL_GPIO        GPIOA
#define I2C1_SCL_PIN         GPIO_Pin_9
#define I2C1_SCL_PIN_SOURCE  GPIO_PinSource9
#define I2C1_SCL_CLK_SOURCE  RCC_AHBPeriph_GPIOA
#define I2C1_SDA_GPIO        GPIOA
#define I2C1_SDA_PIN         GPIO_Pin_10
#define I2C1_SDA_PIN_SOURCE  GPIO_PinSource10
#define I2C1_SDA_CLK_SOURCE  RCC_AHBPeriph_GPIOA

#define I2C2_SCL_GPIO        GPIOA
#define I2C2_SCL_PIN         GPIO_Pin_9
#define I2C2_SCL_PIN_SOURCE  GPIO_PinSource9
#define I2C2_SCL_CLK_SOURCE  RCC_AHBPeriph_GPIOA
#define I2C2_SDA_GPIO        GPIOA
#define I2C2_SDA_PIN         GPIO_Pin_10
#define I2C2_SDA_PIN_SOURCE  GPIO_PinSource10
#define I2C2_SDA_CLK_SOURCE  RCC_AHBPeriph_GPIOA

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Naze32Pro STMF3 help thread

Post by treym »

jihlein wrote:Guess I'm confused (it's been that kind of a day...). Code shows PA9/PA10:


iirc the issue is to be fixed somewhere in :

https://bitbucket.org/treymarc/baseflig ... ?at=master


edit : too much failwork atm ,cant help much more , no time :(

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Naze32Pro STMF3 help thread

Post by treym »

whatever is wrong , the comment or the doc .. the code work . i will look at it since i need adc/rssi support

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Naze32Pro STMF3 help thread

Post by jihlein »

My concern is the using the rx input pins on the Naze32Pro for I2C may be problematic because if I recall correctly, there's a resistor between the processor pin and the I/O pin. I know the driver works as written, at least on a STM32F3 Discovery with Flying F3 shield and the ST accel/mag combination device.

From my logic traces, it's as if the slave I2C device can't pull the SDA line low enough to be interpreted as a logic 0. But if you've had it working, I'll keep looking for the difference in the drivers.

What's your I2C clock frequency? I'm assuming your using syscIk at 72 MHz, that's what I'm using FWIW. If that is true, I don't see how you can be using a prescaler value of zero. I put together a spreadsheet that attempts to calculate the 5 values for the bit fields in the timing register. I can send you that if interested.

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Naze32Pro STMF3 help thread

Post by jihlein »

Okay, read your code some, see you are using the sysclk at 72 MHz.

Looking over your timing register values, I see how you are getting to ~400 kHz clock, but from my understanding (which obviously isn't too good), the values for SDADEL and SCLDEL don't fall within the range specified in the reference manual.

I've taken your driver, modified it for the PB8 and PB9 pins, and will give a try.

This is way more difficult than it needs to be. Thanks for helping!!

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Naze32Pro STMF3 help thread

Post by treym »

jihlein wrote:Okay, read your code some, see you are using the sysclk at 72 MHz.


iirc ,that hse value is also re-setted, not sure where i did that , somewheere else, but as reported from debug msp cycletime and main cpu freq is correct .. will check that this weekend :)

jihlein wrote:but from my understanding (which obviously isn't too good)

well , my understanding is solely base on a pdf datsheet reading and irc chat, so you prolly knwo better than me, i have no clue about how to check the heck of a thing .. and what your are reffering to is based on your own code . cqfd :)

Phobos
Posts: 2
Joined: Fri Jul 25, 2014 9:47 am

Re: Naze32Pro STMF3 help thread

Post by Phobos »

treym wrote:Short answer , you would need something faster than a stm32f3@72mhz , code can be made faster but i dont think it can be made as fast as : 1/8000 - 125 , a stm32f4@168mhz will meet the required speed ( ~73 ) i can say not much but it is believed that the next NazePro version will aslo meet the required speed :p


What would be the target NazePro-next-version chip then? F303, F407 or something else?
Reason I'm asking is I have stm32f3 and f4 discovery boards and would like to tinker with the nazepro soft a little. Maybe I'll be able to write something useful for a change. But if the next gen version is going to be based on a different chip, I'd like to get one and work on it instead.

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Naze32Pro STMF3 help thread

Post by treym »

this may require a very long answer .. :)

short answer (as of today) get a quantom .

Or uou may want to play with your disco f4 , changes are in drivers, nothing intense nor time consuming to changes or to adapte to new a scheme of coding.

User avatar
Dilbert66
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Naze32Pro STMF3 help thread

Post by Dilbert66 »

treym, looks like the latest version of the compiled release dfu is not saving settings. Keeps reverting back to default on reboot. I have not had a chance to look at the code so can't comment on what the issue is. I have not rebuilt my dev enviro so didnt recompile to try out locally. Just noting it for your reference.

Edit: ok, i did a quick pull and compile of the latest code and ran it. All is good. The dfu version on bitbucket must be from an older revision.

jihlein
Posts: 27
Joined: Sat Sep 08, 2012 3:10 pm

Re: Naze32Pro STMF3 help thread

Post by jihlein »

Regarding getting the external mag to work in my build, I had a severe case of stupid going on.

The F4 I2C driver I use wants the mag address as 0x1E, the F3 I2C driver I have wants the mag address as 0x32. Forgot about that little detail.

Changed the address in my F3 code to 0x32, and what do you know, it works. Wow, did I waste some time on that!!

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Naze32Pro STMF3 help thread

Post by brm »

jihlein wrote:Regarding getting the external mag to work in my build, I had a severe case of stupid going on.

The F4 I2C driver I use wants the mag address as 0x1E, the F3 I2C driver I have wants the mag address as 0x32. Forgot about that little detail.

Changed the address in my F3 code to 0x32, and what do you know, it works. Wow, did I waste some time on that!!


welcome to the club.
lately i created a memory overwrite thing ... two weekends flying and landing belly up all the time.
initially i though it was a defective flightcontroler ... but it was me :(

danhouldsworth
Posts: 19
Joined: Fri Aug 01, 2014 2:06 pm

Re: Naze32Pro STMF3 help thread

Post by danhouldsworth »

Hi Gents - not sure if this thread is still active. I've been out of touch for a while as the day job got a bit busy, but I'm am back and keen to get back to tinkering in my man cave....
Couple of questions I'd appreciate some pointers to:
- Did the Naze board with SPI MPU6000 and FPU make it to production? TC - a while back you offered to ship me some proto boards if I pinged you, can I still buy some off you? I need to remember what my plans were here - but I'm keen to experiment with oversampling of the MPU.
- I've built a pretty cool automated propellor thrust bench test station around the AfroESC / SimonK. But now I want to write the ESC code from the ground up (I'm experimenting with spin up times). I need to get hold of the up to date schematic for the board but this (https://code.google.com/p/afrodevices/wiki/AfroESC) is pretty out of date. I'm particularly after the gate drivers on the high side which bootstrap voltate above Vbatt. Anyone have them to hand?
- On the above, seems Hobbyking is now shipping a new version. Are the changes (I've still got a few dozen from last year I've yet to use, 20A/30A/20Aslim and 30aHV) anything significant?
- Lastly, I notice HK is shipping the Afro ESC with OneShot125. TC - I'm pretty sure you'd made clear the claims on this signalling protocol were baseless (which I broadly agreed with). What gives...?

ps. I appreciate these are mainly, Afro ESC questions - but you guys know what you're talking about so thought I'd come here first.

Post Reply