[SOLVED] CF 2.0 not restarting in firmware mode
Re: CF 2.0 not restarting in firmware mode after flashing
I tested your latest firmware with 100kHz I2C1 and changing the MB1242 device address to 0x50 (eeprom). I don't get any issues with the cfclient. Things seem to work as it should, very strange. Can you try changing the MB1242 device address as well?
Re: CF 2.0 not restarting in firmware mode after flashing
Yes, with the original firmware everything's fine. Didn't even change the cfclient.tobias wrote:Well to steps forward and one back .
I'm thinking there is still something wrong with the i2c buss then. If you flash the release software I guess everything is working as it should (to rule out cfclient issue)?
Had an address conflict in mind, too. I'll check this.tobias wrote:I tested your latest firmware with 100kHz I2C1 and changing the MB1242 device address to 0x50 (eeprom). I don't get any issues with the cfclient. Things seem to work as it should, very strange. Can you try changing the MB1242 device address as well?
Re: CF 2.0 not restarting in firmware mode after flashing
Yesterday, I did some more testing:
Unfortunately, this doesn't solve the hang-up on copter's startup:
The motors spin up just normally and the red heart beat (low frequency) shows up. The latter is only visible as long as the copter is moving. As soon as I place it on the table and the self-test/IMU calibration passes, the red LED flashes one or two more times (with higher frequency) and then stays dark. At this stage I can find the copter with the PC Client, but connecting isn't possible. I was able to see a very short I2C communication (few milliseconds) on the oscilloscope when powering the copter so I'll try to trigger this again and take a screenshot. I could take a video of the copter's start-up, too.
Any suggestions?
- Added function to change the I2C address of the sonar sensor. See my repo, branch "sonar-cf2"
- Successfully changed the sensor's address to 0x30.
- Verified the new address via sensor pin 2 by looking at the address announcement with an oscilloscope (pin 2 high for 4,8 ms on start-up represents 48 dec which equals 30 hex).
- Changed the I2C address (MB1242_I2C_ADDRESS) in my code to 0x30 accordingly, of course.
Unfortunately, this doesn't solve the hang-up on copter's startup:
The motors spin up just normally and the red heart beat (low frequency) shows up. The latter is only visible as long as the copter is moving. As soon as I place it on the table and the self-test/IMU calibration passes, the red LED flashes one or two more times (with higher frequency) and then stays dark. At this stage I can find the copter with the PC Client, but connecting isn't possible. I was able to see a very short I2C communication (few milliseconds) on the oscilloscope when powering the copter so I'll try to trigger this again and take a screenshot. I could take a video of the copter's start-up, too.
Any suggestions?
Re: CF 2.0 not restarting in firmware mode after flashing
I got a MB1242 in the mail today!
I hooked it up to a breadboard and grounded pin 1 to set default address (0x70). I changed that in your code and tried it.
It started communicating right away however after ~10s it stopped and the CF2 froze. (timeout bug) because the MB1242 didn't answer for over 100ms.
I changed the code to only take readings every 100ms. it still froze after a while. Now I changed the I2C clock to 400kHz and now it seems to be communicating fine. One little problem though, the range reading is always 765 (0x02FD)... Have not yet investigated this.
You haven't by any chance wired the MB1242 wrongly, swapped SDA and SCL?
I hooked it up to a breadboard and grounded pin 1 to set default address (0x70). I changed that in your code and tried it.
It started communicating right away however after ~10s it stopped and the CF2 froze. (timeout bug) because the MB1242 didn't answer for over 100ms.
I changed the code to only take readings every 100ms. it still froze after a while. Now I changed the I2C clock to 400kHz and now it seems to be communicating fine. One little problem though, the range reading is always 765 (0x02FD)... Have not yet investigated this.
You haven't by any chance wired the MB1242 wrongly, swapped SDA and SCL?
Re: CF 2.0 not restarting in firmware mode after flashing
Apparently my fat belly was not a good object for the sonar to take readings on and now it seem to work pretty fine. I also soldered the header on the MB1242 which I didn't want to do at first which could have made a difference.
Re: CF 2.0 not restarting in firmware mode after flashing
Perfect, great job! Glad that my code works fine. Thanks for buying the sonar, even though I could have lent you mine! Where did you get it from?
I'm going to play around with my equipment again tonight, check my prototype soldering and breakout board wiring.
What's that software on your screenshot for I2C debugging called? Is there additional hardware needed for this?
I'm going to play around with my equipment again tonight, check my prototype soldering and breakout board wiring.
What's that software on your screenshot for I2C debugging called? Is there additional hardware needed for this?
Re: CF 2.0 not restarting in firmware mode after flashing
I followed your report step by step (except for grounding pin 1, I'm still using address 0x30), but no change. I double and triple checked the prototype board and also hooked the sensor up again from scratch without the board in between --> copter always shows the same symptoms i.e. freezing after flashing the red LED twice when switched on lying on the table.
I really don't have any clue what's going wrong here!
I really don't have any clue what's going wrong here!
Re: CF 2.0 not restarting in firmware mode after flashing
Yes it requires additional hardware and I'm using the beagle from totalphase. There are many alternatives e.g. the bus pirate.What's that software on your screenshot for I2C debugging called? Is there additional hardware needed for this?
My best guess is that the MB1242 doesn't respond for some reason. As talking to the EEPROM works? the I2C bus should be functioning. An analyzer would help you find the problem quickly.
Re: CF 2.0 not restarting in firmware mode after flashing
It is working!!
Connected pin 1 to GND to set the sensor's address to default 0x70 and initialized I2C1_DEV with 100 kHz. It works for RANGING_CYCLE_MS = 80 or 100, doesn't matter.
I don't know what the reason was, actually. Tested with the same address in the beginning. To speak from my own experience: electronic components, especially in complex environments like this one with many dependencies (bus speed, read frequency, other peripherals on the same bus, sensor-specific details), sometimes behave unexpectedly. Still need to learn alot, though.
Thanks to everyone who spent time (and money!) on helping me.
Glad to have you in the forums more often again, Bitcraze guys!
Connected pin 1 to GND to set the sensor's address to default 0x70 and initialized I2C1_DEV with 100 kHz. It works for RANGING_CYCLE_MS = 80 or 100, doesn't matter.
I don't know what the reason was, actually. Tested with the same address in the beginning. To speak from my own experience: electronic components, especially in complex environments like this one with many dependencies (bus speed, read frequency, other peripherals on the same bus, sensor-specific details), sometimes behave unexpectedly. Still need to learn alot, though.
Thanks to everyone who spent time (and money!) on helping me.
Glad to have you in the forums more often again, Bitcraze guys!