Stellaris Cortex M4F (preorder for september, 4.99$)

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Anyone have code working with MPU6050 or HMC5583L or MS5611 yet?

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

If you supply the rest of the baseflight/MW code adapted to the launchpad the basic code for sensors should be quite easy ... we´ve seen some results here but "aBUGSworstnightmare" seems to be one of the few ones sharing his results. I would buy his product and I could afford, but my hobby is not buying things.
I like the idea of having the SW before the 2nd hardware run, less waste and I have children...

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

I have some boards and components. One board is completed, but I haven't had time to write sensor tests so I have no idea if it works, haha.

If someone is interested in helping out with the code, I'm willing to send them one of my boards at cost. $35. Bitcoin accepted.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Better yet, if they can promise to get the code working I will give one for free.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Here's a pic
Attachments
photo.JPG

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

aimatt wrote:Anyone have code working with MPU6050 or HMC5583L or MS5611 yet?


I have; tested and it works well. I also have code for battery, gps, sonar...
So, what's your goal? You want to port baseflight on the launchpad?
I wrote my code a few time ago, and it uses Freertos, but if you want I can modify to run with the baseflight code.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Yes, I would love baseflight ported. Are you interested? Basically if there's no code working for this thing (assuming that mechanically it is good) then customers don't have much of a reason to buy it.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

Well, I should be able to port baseflight on this board, with these sensors: MPU6050 / HMC5883 / MS5611, since I only have the following IMU:
http://www.drotek.fr/shop/en/62-imu-10dof-mpu6050-hmc5883-ms5611.html

Give me 2 or 3 days (I'm a little busy right now), and I'll post something.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

That should work. These are the same sensors except my board has the BA03 stainless steel shell update (I think it's a little more accurate too).

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

I've got the baseflight repo forked on github if you wanna work on that one: https://github.com/mattwilliamson/baseflight-stellaris

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

vdjc wrote:So, what's your goal? You want to port baseflight on the launchpad?

Me, too. The FreeRTOS code would be also interesting.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

@aimatt
Please, what's the pinout on your board (PWM/I2C/UART/..)? I would like to update the code before uploading it.
Actually I've go something compiling and running with Multiwiiconf, but there're probably a lot of bugs.
FYI, I use crossworks to build the project, so you'll need either to get a trial version, either to convert it to your prefered IDE...
I don't have much time to do it (work, children...) so I hope others will improve the code.

@gompf-2
I've used FreeRTOS in another project, it's not integrated with baseflight code.
Also, I've tried to change as little as possible the baseflight code, to keep it in sync easily.
Moreover, debugging code with FreeRTOS can be a nightmare...

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

The ppinout is on the silkscreen. Here's a scan https://dl.dropbox.com/u/14573179/tindie/bosterpack-imu.png

You have a launchpad already? If not, I could send one of those too.

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

vdjc wrote:FYI, I use crossworks to build the project, so you'll need either to get a trial version, either to convert it to your prefered IDE...
I don't have much time to do it (work, children...) so I hope others will improve the code.

I would like to convert it to Code Composer Studio and try my best.
aimatt wrote:The ppinout is on the silkscreen.

Ok, easy things were
PD0-3,6,7 for WT2-0/1,WT3-0/1,WT5-0, WT1-1
UART3, UART4
But, which port did you use for sensors I2C? I2C1 is present on PA6/7 but it seems you connected the MPUs INT to PA7. Also I see vias on the MPUs AUX I2C but don´t have the bottom layer.
PE4/5 would be an option for I2C2 but doesn´t seem to be connected when I look in the "baro corner" (interconnection MPU-BARO seems clear).
(Hope I don´t have a "mirror" problem in my head?)

Have you tried the busscan routine from aBUGSworstnightmare´s I2C-driver? This should give a rough test of the bus.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

aimatt wrote:The ppinout is on the silkscreen. Here's a scan https://dl.dropbox.com/u/14573179/tindie/bosterpack-imu.png

You have a launchpad already? If not, I could send one of those too.


Yes I already have one, thanks!
As I told, baseflight is now running on my launchpad (pwm/ppm not yet finished).
For now, I have the same questions as gompf-2, regarding the pinout.
Would it be possible to see your schematic?

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Yes, I can share. Please note the schematic says Creative Commons, but I am not releasing it under a license as of now until I see where this is going. So technically copyright for now. Here it is: https://www.dropbox.com/s/u4owfnz5h2ss5i7/schematic.png

vdjc, is your code online?

I have not tried the bus scan yet, that's this right? http://e2e.ti.com/support/microcontroll ... 35977.aspx

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

Thanks for the schematic. The code is not yet online, but I'll put it on github or googlecode this week-end (or wherever you want).

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

Thanks, too. Ok, MPU and Baro on I2C0, Mag at MPUs AUX.

aimatt wrote:I have not tried the bus scan yet, that's this right?

Correct. I put it together with some other stuff into a CCS-project, in case you use CCS just uncomment busscan in the main file:http://www.multiwii.com/forum/viewtopic.php?f=22&t=2376&start=40#p30275
It should find the MPUs and BAROs adress.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

I implemented bus scan, and I'm not too enthused to see that something is ACKing to every single address. Here's my code adopted from the TI forums per your recommendation:

https://gist.github.com/mattwilliamson/ ... 261dc9a4c9

I'm seeing this over the serial line:

Address found: 0x 0 - 0
Address found: 0x 1 - 1
Address found: 0x 2 - 2
Address found: 0x 3 - 3
Address found: 0x 4 - 4
Address found: 0x 5 - 5
Address found: 0x 6 - 6
Address found: 0x 7 - 7
Address found: 0x 8 - 8
Address found: 0x 9 - 9
Address found: 0x a - 10
Address found: 0x b - 11
Address found: 0x c - 12
Address found: 0x d - 13
Address found: 0x e - 14
Address found: 0x f - 15
Address found: 0x10 - 16
Address found: 0x11 - 17
Address found: 0x12 - 18
Address found: 0x13 - 19
Address found: 0x14 - 20
Address found: 0x15 - 21
Address found: 0x16 - 22
Address found: 0x17 - 23
Address found: 0x18 - 24
Address found: 0x19 - 25
Address found: 0x1a - 26
Address found: 0x1b - 27
Address found: 0x1c - 28
Address found: 0x1d - 29
Address found: 0x1e - 30
Address found: 0x1f - 31
Address found: 0x20 - 32
Address found: 0x21 - 33
Address found: 0x22 - 34
Address found: 0x23 - 35
Address found: 0x24 - 36
Address found: 0x25 - 37
Address found: 0x26 - 38
Address found: 0x27 - 39
Address found: 0x28 - 40
Address found: 0x29 - 41
Address found: 0x2a - 42
Address found: 0x2b - 43
Address found: 0x2c - 44
Address found: 0x2d - 45
Address found: 0x2e - 46
Address found: 0x2f - 47
Address found: 0x30 - 48
Address found: 0x31 - 49
Address found: 0x32 - 50
Address found: 0x33 - 51
Address found: 0x34 - 52
Address found: 0x35 - 53
Address found: 0x36 - 54
Address found: 0x37 - 55
Address found: 0x38 - 56
Address found: 0x39 - 57
Address found: 0x3a - 58
Address found: 0x3b - 59
Address found: 0x3c - 60
Address found: 0x3d - 61
Address found: 0x3e - 62
Address found: 0x3f - 63
Address found: 0x40 - 64
Address found: 0x41 - 65
Address found: 0x42 - 66
Address found: 0x43 - 67
Address found: 0x44 - 68
Address found: 0x45 - 69
Address found: 0x46 - 70
Address found: 0x47 - 71
Address found: 0x48 - 72
Address found: 0x49 - 73
Address found: 0x4a - 74
Address found: 0x4b - 75
Address found: 0x4c - 76
Address found: 0x4d - 77
Address found: 0x4e - 78
Address found: 0x4f - 79
Address found: 0x50 - 80
Address found: 0x51 - 81
Address found: 0x52 - 82
Address found: 0x53 - 83
Address found: 0x54 - 84
Address found: 0x55 - 85
Address found: 0x56 - 86
Address found: 0x57 - 87
Address found: 0x58 - 88
Address found: 0x59 - 89
Address found: 0x5a - 90
Address found: 0x5b - 91
Address found: 0x5c - 92
Address found: 0x5d - 93
Address found: 0x5e - 94
Address found: 0x5f - 95
Address found: 0x60 - 96
Address found: 0x61 - 97
Address found: 0x62 - 98
Address found: 0x63 - 99
Address found: 0x64 - 100
Address found: 0x65 - 101
Address found: 0x66 - 102
Address found: 0x67 - 103
Address found: 0x68 - 104
Address found: 0x69 - 105
Address found: 0x6a - 106
Address found: 0x6b - 107
Address found: 0x6c - 108
Address found: 0x6d - 109
Address found: 0x6e - 110
Address found: 0x6f - 111
Address found: 0x70 - 112
Address found: 0x71 - 113
Address found: 0x72 - 114
Address found: 0x73 - 115
Address found: 0x74 - 116
Address found: 0x75 - 117
Address found: 0x76 - 118
Address found: 0x77 - 119
Address found: 0x78 - 120
Address found: 0x79 - 121
Address found: 0x7a - 122
Address found: 0x7b - 123
Address found: 0x7c - 124
Address found: 0x7d - 125
Address found: 0x7e - 126
I2C Bus-Scan done...

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Oh I was thinking I was passing in what I though was the I2C address but it's supposed to be the base. I'll update shortly.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Ok, fixed it up:

I2C Bus-Scan starting...
ROM_I2CMasterBusy
Probing...
Address not found: 0x 0 - 0
Address not found: 0x 1 - 1
Address not found: 0x 2 - 2
Address not found: 0x 3 - 3
Address not found: 0x 4 - 4
Address not found: 0x 5 - 5
Address not found: 0x 6 - 6
Address not found: 0x 7 - 7
Address not found: 0x 8 - 8
Address not found: 0x 9 - 9
Address not found: 0x a - 10
Address not found: 0x b - 11
Address not found: 0x c - 12
Address not found: 0x d - 13
Address not found: 0x e - 14
Address not found: 0x f - 15
Address not found: 0x10 - 16
Address not found: 0x11 - 17
Address not found: 0x12 - 18
Address not found: 0x13 - 19
Address not found: 0x14 - 20
Address not found: 0x15 - 21
Address not found: 0x16 - 22
Address not found: 0x17 - 23
Address not found: 0x18 - 24
Address not found: 0x19 - 25
Address not found: 0x1a - 26
Address not found: 0x1b - 27
Address not found: 0x1c - 28
Address not found: 0x1d - 29
Address not found: 0x1e - 30
Address not found: 0x1f - 31
Address not found: 0x20 - 32
Address not found: 0x21 - 33
Address not found: 0x22 - 34
Address not found: 0x23 - 35
Address not found: 0x24 - 36
Address not found: 0x25 - 37
Address not found: 0x26 - 38
Address not found: 0x27 - 39
Address not found: 0x28 - 40
Address not found: 0x29 - 41
Address not found: 0x2a - 42
Address not found: 0x2b - 43
Address not found: 0x2c - 44
Address not found: 0x2d - 45
Address not found: 0x2e - 46
Address not found: 0x2f - 47
Address not found: 0x30 - 48
Address not found: 0x31 - 49
Address not found: 0x32 - 50
Address not found: 0x33 - 51
Address not found: 0x34 - 52
Address not found: 0x35 - 53
Address not found: 0x36 - 54
Address not found: 0x37 - 55
Address not found: 0x38 - 56
Address not found: 0x39 - 57
Address not found: 0x3a - 58
Address not found: 0x3b - 59
Address not found: 0x3c - 60
Address not found: 0x3d - 61
Address not found: 0x3e - 62
Address not found: 0x3f - 63
Address not found: 0x40 - 64
Address not found: 0x41 - 65
Address not found: 0x42 - 66
Address not found: 0x43 - 67
Address not found: 0x44 - 68
Address not found: 0x45 - 69
Address not found: 0x46 - 70
Address not found: 0x47 - 71
Address not found: 0x48 - 72
Address not found: 0x49 - 73
Address not found: 0x4a - 74
Address not found: 0x4b - 75
Address not found: 0x4c - 76
Address not found: 0x4d - 77
Address not found: 0x4e - 78
Address not found: 0x4f - 79
Address not found: 0x50 - 80
Address not found: 0x51 - 81
Address not found: 0x52 - 82
Address not found: 0x53 - 83
Address not found: 0x54 - 84
Address not found: 0x55 - 85
Address not found: 0x56 - 86
Address not found: 0x57 - 87
Address not found: 0x58 - 88
Address not found: 0x59 - 89
Address not found: 0x5a - 90
Address not found: 0x5b - 91
Address not found: 0x5c - 92
Address not found: 0x5d - 93
Address not found: 0x5e - 94
Address not found: 0x5f - 95
Address not found: 0x60 - 96
Address not found: 0x61 - 97
Address not found: 0x62 - 98
Address not found: 0x63 - 99
Address not found: 0x64 - 100
Address not found: 0x65 - 101
Address not found: 0x66 - 102
Address not found: 0x67 - 103
Address found: 0x68 - 104
Address not found: 0x69 - 105
Address not found: 0x6a - 106
Address not found: 0x6b - 107
Address not found: 0x6c - 108
Address not found: 0x6d - 109
Address not found: 0x6e - 110
Address not found: 0x6f - 111
Address not found: 0x70 - 112
Address not found: 0x71 - 113
Address not found: 0x72 - 114
Address not found: 0x73 - 115
Address not found: 0x74 - 116
Address not found: 0x75 - 117
Address not found: 0x76 - 118
Address found: 0x77 - 119
Address not found: 0x78 - 120
Address not found: 0x79 - 121
Address not found: 0x7a - 122
Address not found: 0x7b - 123
Address not found: 0x7c - 124
Address not found: 0x7d - 125
Address not found: 0x7e - 126
I2C Bus-Scan done...
I2C Bus-Scan complete

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Looks like hte HMC5883 didn't show up. I put it on the MPU's AUX line, but I though passthrough was the default configuration?

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

By using the aux the MPUs DMP core has access to the sensor, but according to some posts regarding the DMP it´s not useful for us. It would have been more easy to have the MAG just on the same bus for the start and don´t have to mess around with the aux code for the MPU.
But we´ll see what vdjc can do ;)
At least the sensor connection for MPU/BARO seems to be OK so your hardware is fine regarding to this two.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Early on I was really hoping to use the DMP, but as I dug and dug I found that it's a piece of crap tightly controlled and terribly documented feature. I didn't think to move it to the main bus because I though I had read in a forum post that the MPU6050 configures the AUX line as passthru by default. Oh well, we just have to write a register or two I think.

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

Yes, just wanted to write that...
Pass-Through Mode: The MPU-60X0 directly connects the primary and auxiliary I2C buses together, allowing the system processor to directly communicate with any external sensors.

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Oh, looks like baseflight has DMP support from the looks of it. There is a macro: MPU6050_DMP

As for ATmega multiwii, here is was the passthrough access looks like

Configuration:

#if defined(MPU6050_I2C_AUX_MASTER)
//at this stage, the MAG is configured via the original MAG init function in I2C bypass mode
//now we configure MPU as a I2C Master device to handle the MAG via the I2C AUX port (done here for HMC5883)
i2c_writeReg(MPU6050_ADDRESS, 0x6A, 0b00100000); //USER_CTRL -- DMP_EN=0 ; FIFO_EN=0 ; I2C_MST_EN=1 (I2C master mode) ; I2C_IF_DIS=0 ; FIFO_RESET=0 ; I2C_MST_RESET=0 ; SIG_COND_RESET=0
i2c_writeReg(MPU6050_ADDRESS, 0x37, 0x00); //INT_PIN_CFG -- INT_LEVEL=0 ; INT_OPEN=0 ; LATCH_INT_EN=0 ; INT_RD_CLEAR=0 ; FSYNC_INT_LEVEL=0 ; FSYNC_INT_EN=0 ; I2C_BYPASS_EN=0 ; CLKOUT_EN=0
i2c_writeReg(MPU6050_ADDRESS, 0x24, 0x0D); //I2C_MST_CTRL -- MULT_MST_EN=0 ; WAIT_FOR_ES=0 ; SLV_3_FIFO_EN=0 ; I2C_MST_P_NSR=0 ; I2C_MST_CLK=13 (I2C slave speed bus = 400kHz)
i2c_writeReg(MPU6050_ADDRESS, 0x25, 0x80|MAG_ADDRESS);//I2C_SLV0_ADDR -- I2C_SLV4_RW=1 (read operation) ; I2C_SLV4_ADDR=MAG_ADDRESS
i2c_writeReg(MPU6050_ADDRESS, 0x26, MAG_DATA_REGISTER);//I2C_SLV0_REG -- 6 data bytes of MAG are stored in 6 registers. First register address is MAG_DATA_REGISTER
i2c_writeReg(MPU6050_ADDRESS, 0x27, 0x86); //I2C_SLV0_CTRL -- I2C_SLV0_EN=1 ; I2C_SLV0_BYTE_SW=0 ; I2C_SLV0_REG_DIS=0 ; I2C_SLV0_GRP=0 ; I2C_SLV0_LEN=3 (3x2 bytes)
#endif




Reading:

i2c_getSixRawADC(MPU6050_ADDRESS, 0x49); //0x49 is the first memory room for EXT_SENS_DATA

MAG_ORIENTATION( ((rawADC[0]<<8) | rawADC[1]) ,
((rawADC[4]<<8) | rawADC[5]) ,
((rawADC[2]<<8) | rawADC[3]) );

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

A little more research. I found this here: https://github.com/jrowberg/i2cdevlib/b ... PU6050.cpp



#define MPU6050_RA_INT_PIN_CFG 0x37
#define MPU6050_INTCFG_I2C_BYPASS_EN_BIT 1
#define MPU6050_USERCTRL_I2C_MST_EN_BIT 5


/** Set I2C bypass enabled status.
* When this bit is equal to 1 and I2C_MST_EN (Register 106 bit[5]) is equal to
* 0, the host application processor will be able to directly access the
* auxiliary I2C bus of the MPU-60X0. When this bit is equal to 0, the host
* application processor will not be able to directly access the auxiliary I2C
* bus of the MPU-60X0 regardless of the state of I2C_MST_EN (Register 106
* bit[5]).
* @param enabled New I2C bypass enabled status
* @see MPU6050_RA_INT_PIN_CFG
* @see MPU6050_INTCFG_I2C_BYPASS_EN_BIT
*/
void MPU6050::setI2CBypassEnabled(bool enabled) {
I2Cdev::writeBit(devAddr, MPU6050_RA_INT_PIN_CFG, MPU6050_INTCFG_I2C_BYPASS_EN_BIT, enabled);
}





So we just need to set register 106, bit 5 to 0 and register 106, bit 1 to 1.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

Yes, the drotek 10DOF I use has the same configuration: MAG on mpu6050 I2C AUX line and it works perfectly with the I2C_BYPASS_EN set to 1 (mpu6050 INT_PIN_CFG register) and do not requires -fortunately- to use the DMP.

But IMHO don't loose your time reinventing the wheel: the baseflight code is well written (thanks to Timecop) and it works perfectly for your sensors.
We just have to replace some low-level drivers (drv_i2c, drv_uart, drv_pwm) to port the baseflight code to the launchpad.
I've created a repository here: https://github.com/vdjc/baseflight and I'll commit my code very soon (tomorrow if I have some time).
I'll keep you informed

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Fantastic, I'm very excited to try it out. I assume it works with the Java gui just fine?

I'm getting props next week so I may be able to get it in the air :D

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

I've started to upload some code here: https://github.com/vdjc/baseflight
It's still very premature, but at least it compiles using crossworks or sourcery. I've not tested at all the sourcery version.
Cli and java gui works, as well as sensors, but all the code related to pwm (in/out) remains to be done.
I'm not sure it will go in the air next week...
Volunteers to help coding are welcome!

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Outstanding. These commits look great. Good thing we have some PWM code samples in this thread...

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

The code looks like it's been done very well. Nice job so far.

I used command line to compile and I changed the Makefile to output a binary instead of a hex file so I could use TI's flash utility to burn it. It wurned successfully but I don't see any LED activity and the GUI is not showing anything. Could you send over a .bin file that works for you so I can just try it out?

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aBUGSworstnightmare »

Hi,

glad to see that this is improving (and there some folks around making use of the I2C driver)!

Since I own Crossworks and CCS I will give it a try later on. I'm stuck with my microSD card code at the moment. I need to check my hardware; maybe the bus capacity is a little high (trace length; unfortunately SSI0 is scattered between J1 and J2).

I only had a brief look at timecops baseflight code so far. I have my own NMEA interpreter since I plan to add some additional feature were I will need it for.

MY BMP180 is on the MPU-9150 AUX bus --> I hope to get a 10DOF fusion running once I have access to the DMP documentation (which is available under NDA).

Rgds
aBUGSworstnightmare

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aBUGSworstnightmare »

vdjc wrote:I've started to upload some code here: https://github.com/vdjc/baseflight
It's still very premature, but at least it compiles using crossworks or sourcery. I've not tested at all the sourcery version.
Cli and java gui works, as well as sensors, but all the code related to pwm (in/out) remains to be done.
I'm not sure it will go in the air next week...
Volunteers to help coding are welcome!


Hi vdjc,

just had a brief look at your posted code. Looks like your using drivers (I2C and UART at least) written for use with TI-RTOS, right? Using TI-RTOS was in my mind too (once I fixed my microSD problem).

aBUGSworstnightmare

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

Hi,

thanks for your code, vdjc.
aimatt wrote:I used command line to compile and I changed the Makefile to output a binary instead of a hex file so I could use TI's flash utility to burn it.

I tried the same, build process itself looks fine but only get a nearly empty hex/bin.
1st drawback of the platform: As I´m more the "low level function" guy I tried to implement Jeti Telemetry but it seems there is now way of doing this with hardware serial on the Stellaris: We need 9bit mode with odd parity, there is an "ugly hack" (AN1280) for 9-bit serial but this uses the parity bit set as sticky to emulate bit 9, no way to get this together with hardware parity.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

OK, I've fixed the Makefile and add a startup code for gcc. It should build normally now.
I've still have a strange issue: the code is working fine in debug mode, but fails in release mode.
It seems to be caused by the sensor detection routine, so the i2c code is probably not working in release mode (timing issue??).

@aBUGSworstnightmare
No I didn't write the code for TI-RTOS. I've used it with FreeRTOS, but it's not specifically intended for an RTOS system.

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

Fixed: it was GCC optimization issue (missing volatile keyword).
Also, you can type "make bin" to get a bin file

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

Thanks for the fast fix!

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

The compile worked and it flashed properly. Exciting! I was also able to connect via the multiwii gui, but all I am getting are crazy looking values for the acc. Is it my hardware? :'(
Attachments
Screen Shot 2013-02-10 at 11.37.07 AM.png

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Actually I hit calibrate ACC and when I tilt the board an I actually see it reflected on the gui but it is very slow and noisy, which makes me even more scared it's my hardware. That and there's not MAG, GYRO or BARO info.

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

Seems we´ve still some problems with the I2C/command line makefile...
(don´t take it wrong, vdjc, you did an outstanding job).
I tried to get it to work with ITG3200 (with modified DRV_MPU3050 sources) and ADXL345 (as I´m still waiting for my chinese IMU and didn´t wont to rip my flying copter apart).
I modified the code/makefile to use modified DRV_MPU3050 (unimpemented.c etc./MPU3050 vs. itg3200 registers/init sequence) and I can check that "my" driver file is used during compile (by altering failure code in MPU detection routine) but most often I don´t get an ACKN in the autodetection routine altough I2C-Busscan (with different I2C-driver) shows up the sensors. During checks with an oszi I observed that at 50% of the MCUs resets the I2C remains dead (proping SCL).
But maybe it´s just my Stellaris partly fried during the last weeks of playing around with it, as also the LM-Flash Utility fails in about 50% of "flashes" or some 64bit problems in my toolchain....unfortunately it´s sunday evening again :?
Up to now I´m waiting for next friday, hopefully including a MPU6050 in the RL mailbox ;).

Maybe I can add another thought at the "start of this": vdjc choosed crossworks, timecop is developing in µV4, I´m far away of blaming them for this as they are the more professional developers/this are the more professional toolchains. aBUGSworstnightmare owns crossworks and CCS. I use CCS and can do primitve command line builds with gcc-arm.
Anybody with a Launchpad could download/install/use CCS without restrictions easy and for free, should be also possible with pure Eclipse/plugins but I didn´t get it to work after a day so dropped it.
I know it´s a minor problem for experts, but ATM I´m fighting 50% of the time with problems regarding to different toolchains (maybe I should have bought an Arduino Mega :oops: ).
Any comments?

Have a nice monday :lol:
gompf

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Well, we are still very early in the life of this thing. I'm optimistic!

The toolchain is a pretty big issue though; with Arduino, it's Arduino GUI and/or avrdude. We've got tons of choices with Stellaris and it's a problem. I feel like due to the open nature of the work so far, maybe CCS is the way to go.

Either way, vdjc, do all these sensors work normally for you when you flash using Crossworks? Is there a way to get the bin from that so I can try it out?

Thanks again!

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

@gompf-2
I don't take it wrong, no problem. Last time I tried, using gdb with the launchpad was not easy at all.
That's why I prefer to use an IDE with an integrated/easy to use debugger, so I don't use the makefile for my own usage...

@aimatt
There's a port of the arduino gui for the launchpad: https://github.com/energia/
But why using such a tool when you can have a debugger, with breakpoints, registers dump, ... ?
Regarding the sensors issue, it was 'just' some missing defines (#define MAG GYRO ...) - I've updated the code on github.
Also, I've tried to flash the bin compiled with the makefile, and it works now.
But I agree there's an issue with the i2c driver (and maybe also the uart driver) since the updates are still slow on the GUI.

Feel free to try something else, it should be easy to replace the drv_i2c.c (interrupt mode) with another code, for example the implementation by aBUGSworstnightmare (polling mode).
I'm doing this just for fun, I don't even think that I will fly it one day (I'm happy with my naze32 boards :) ).
I'm willing to continue to help, and I'll try to investigate these issues later, but do not expect me to do everything alone, it's just a hobby and my job already takes me a lot of time...
If some of you want to update the code on github, you can send me your public key and I'll add it to the repo.

EDIT: I've added aBUGSworstnightmare's I2C driver for testing purpose - it's activated by default in board-stellaris.h : #define USE_I2C_POOLING

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

vdjc, our expectations are set. I will help out as much as I an but I am on a completely different level than you when it comes to C and embedded programming. It's also obvious you have a good feel for baseflight which I am getting used to. Baseflight being a port of multiwii is definitely an understatement. Thank you for contributing.

As for the sensors, I'm now seeing some negative value for the baro and the accelerometer is still noisy, but you say you are seeing the same thing. As fer the gyro and mag, I'm still not getting anything. Do you see the same thing or do you see all devices reporting as normal, albeit slowly? Here's a screen:
Attachments
Screen Shot 2013-02-11 at 11.12.56 AM.png

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

I fixed drv_i2c_polling so that it would compile with gcc and it definitely reacts quicker, but still getting noisy values and the device orientation reset like every 10 seconds as if maybe the i2c bus is being reset or something. As for the gyro, I am seeing it update now, but it looks like only the roll?
Attachments
Screen Shot 2013-02-11 at 11.42.28 AM.png

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by vdjc »

aimatt wrote:As for the sensors, I'm now seeing some negative value for the baro and the accelerometer is still noisy, but you say you are seeing the same thing.


No, I see a slow update (little delay between moves and GUI updates) but my sensors show normal values (not noisy, exact baro value...).
While testing, I've broken the micro usb connector (which was obviously badly soldered).
These things are incredibly small! Of course, I've destroyed the board while trying to resolder it :oops:
I should receive another board in a couple of days...

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Darn, I guess my booster pack probably has some issue. I think I'll make another and see if it has the same problem.

gompf-2
Posts: 136
Joined: Sun Jun 05, 2011 11:46 am

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by gompf-2 »

vdjc wrote:I'm willing to continue to help, and I'll try to investigate these issues later, but do not expect me to do everything alone, it's just a hobby and my job already takes me a lot of time...

No problem, family comes first, then job, then fun. As sad as it is sometimes ;-) I have the same problem...
I wasn´t awaiting you to fix all this, I just try to document things.
aimatt wrote:Darn, I guess my booster pack probably has some issue. I think I'll make another and see if it has the same problem.

I´m to tired now to look deeply into this but iirc you have some problems in the electrical design, blocking caps behind vias, boost cap far away from IC... normally not sooo critical for our purpose but may have an affect in sum. As I wrote before I would start testing the code with one of the known good "chinese IMUs" until the next run. I´m not a tree hugger, in my eyes it just makes no sense to work on both ends, yet (and I earn 50% of my money in semiconductor industry, so normally should tell you to start next iteration ;-).
vdjc wrote:While testing, I've broken the micro usb connector (which was obviously badly soldered).
That is the advantage of lead free soldering, higher process temperature and lower quality. Lead free electronic is as outstanding as forced exchange of old filament light bulbs against "energy safers" here in europe :D . If you look at the product life circle, quality/disadvantages and normal disposal of these things, imho both ideas were sh**.
Keep the board for now. If you only broke the programmer/debugger you can reuse it for something else and flash it with the 2nd one.

Regards,
gompf

aimatt
Posts: 51
Joined: Mon Nov 12, 2012 9:17 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by aimatt »

Gompf, if I sent you a PM with my eagle file could I get some pointers from you? I'm doing this as a hobby too. I'm a developer by profession.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Stellaris Cortex M4F (preorder for september, 4.99$)

Post by timecop »

That is the advantage of lead free soldering, higher process temperature and lower quality. Lead free electronic is as outstanding as forced exchange of old filament light bulbs against "energy safers" here in europe


oh comeon.
I use leadfree on everything and have zero issues. MicroUSB connectors are just shit, plain and simple. Especially SMD ones.
I've never had a problem with through-hole USB Mini-B coming off a board (without taking half the board with it).

Post Reply