Hello and welcome to our community! Is this your first visit?
Register
Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42
  1. #1
    Senior Pilot
    Join Date
    Mar 2010
    Posts
    161
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0

    Lightbulb my own 32-bit design

    Code name is M4Quad



    Some rambling of mine about it, features, etc:

    https://docs.google.com/document/d/1...PSnm1XWgA/edit

    Pinout plan
    https://docs.google.com/spreadsheet/...WtBdmtOb2w4MGc

    I want to keep the entire project open source, and I would like to cooperate with the “AeroQuad32” or “Baloo” efforts. To do so, I want to make a few notes:

    The code should ideally be written in such a way to utilize the ARM Cortex M4’s special feature, which is the FPU. This means using single precision floating point numbers. If this is impractical for our purposes, let me know. Maybe we need to use a flexible datatype that is defined in a configuration file.

    My strengths are in programming and hardware, stuff like dealing with writing classes, dealing with PWM and PPM and composite PPM, and reading sensors. My weakness probably lies in physics, mathematics, and lack of real RC flying experience. I hope I can borrow existing DCM code or “FlightAngle” code, and write my own high performance hardware interface code that is abstracted. I don’t want to deal with the “Arduino” or “Maple” stuff. I'm also very strict with my own naming and coding conventions.

    It’s possible for me to write my own configuration/monitoring GUI but I’d like my design to be compatible with another GUI like the AeroQuad configurator (or maybe MultiWiiCopter). I am not an artist. As long as I have permission to do this, I can figure out how to keep up with the communication protocol.

    I will only use free tools, this probably means using the GNU GCC toolchain for ARM somehow, probably with Eclipse and makefiles.

    First PCB and electrical test is planned for Janurary of 2012, first test flight is planned for February of 2012 if all goes well.

    EDIT:

    PCB ordered, due to arrive sometime in January, contact me if you want to buy any spare PCB or want to buy any assembled boards

    EDIT: no promises and no transactions until I have assembled and tested one myself

    EDIT: currently under testing
    Last edited by frank26080115; 01-15-2012 at 05:59 AM.

  2. #2
    AeroQuad Core Software Developer ala42's Avatar
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    1,788
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    13
    You forgot to connect BOOT1/PB2. The FPU works fine with the CodeSourcery arm-none-eabi-gcc-4.5.2.exe. I use a modified maple lib that I currently port to the F2/F4 and VS2008 with makefiles as IDE, so no Maple IDE, but a maple lib to be compatible with the AQ software.
    Be aware that Invensense has not published a public available register map for the MPU6000.

  3. #3
    Moderator AeroQuad Technologist Honk's Avatar
    Join Date
    Apr 2010
    Location
    Stockholm
    Posts
    5,442
    Blog Entries
    2
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    1
    I don’t want to deal with the “Arduino” or “Maple” stuff. I'm also very strict with my own naming and coding conventions.
    Might be hard to cooperate if you're not willing to sacrifice a few of your own "rules", but the more who gets experimenting with the STM F4 the better! I think our plan is to get the F4 on the Baloo now, since that got so many exciting features! I hope I will receive the eval board next week so I can get playing. Still a little confused about what lib's/IDE's/compilers to use with it, but I think it'll become clear.
    Smart people don't need a signature.
    http://thechive.files.wordpress.com/...rd-signs-3.jpg

  4. #4
    Senior Pilot
    Join Date
    Mar 2010
    Posts
    161
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    boot1 is connected directly to ground, I'll post the schematic once I have setup git or svn or something

    I've emailed InvenSense about the matter, I'll be working off the reversed engineered register mapping. I have three MPU-6000 enroute via UPS as I speak. The MPU-6050 was not in stock at the time.

    I can always keep two set of code

    I have a free STM32F4Discovery from a few weeks ago
    Last edited by frank26080115; 11-05-2011 at 05:40 PM.

  5. #5
    Senior Pilot
    Join Date
    Mar 2010
    Posts
    161
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    ok, so i've setup YAGARTO which is arm-none-eabi-gcc version 4.6

    I have setup a directory structure that organizes both code from ST and code from libmaple

    I've written a makefile from scratch that seems to be doing things right

    my next goal is to somehow compile the usb_cdcacm code from libmaple for the STM32F4

    what has been done so far to make this transition? a lot of the code doesn't target the STM32F4. I'm not so sure about the changes that will be required inside "stm32.h"

    I've updated the maximum APB frequencies to 84 and 42 MHz in accordance to the stm32f4xx datasheet

    also added this entry
    Code:
    #elif defined(MCU_STM32F405RGT)
    
        #define STM32_NR_GPIO_PORTS          4
        #define STM32_DELAY_US_MULT         12
        #define STM32_SRAM_END              ((void*)0x20020000)
    
        #define NR_GPIO_PORTS               STM32_NR_GPIO_PORTS
        #define DELAY_US_MULT               STM32_DELAY_US_MULT
    the linker script I have is "stm32f4xx_flash.ld" which is different from the one used by libmaple

    I do not quite understand how to get the PLL to go 168 MHz, I've defined "CYCLES_PER_MICROSECOND" to be 168 instead of the old 72, I do not see place where I can indicate that I am running from a 8 MHz crystal but I did change the PLL multiplier to 21 instead of 9

    I've basically increased the AHB speed to 168 MHz from 72 MHz, and APB1 speed to 84 MHz from 72 MHz, and APB2 speed to 42 MHz from 36 MHz

    I'm not sure how the USB driver will handle this change, since now the two APB speeds have changed, but apparently the reference manual says the RCC will generate the USB clock at 48 MHz specifically, but I need to be able to set "PLLQ" in "RCC_PLLCFGR" to divide 168 down to 48, but this does not exist on the F10X chips that the Maple uses, so I can't find a clean way to do this, I might go back to using the API provided by ST, but I'd rather keep everything consistent

    I am having so much trouble with this, it's ridiculous, can you guys give me a hand? what have you done so far?

    The good news is, the makefile works and I can get a binary out of it. Now I have to figure out how to test it on the discovery kit without downloading any "trial" IDEs, apparently ST-Link isn't supported by OpenOCD, so I'll have to try using my BusBlaster. I might also try BOOT0
    Last edited by frank26080115; 11-06-2011 at 06:58 AM.

  6. #6
    AeroQuad Core Software Developer ala42's Avatar
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    1,788
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    13
    Why don't you simply use the flash tool that comes with the ST-Link software to upload your code ? They also have a command line tool, which can be used from a btach file like this:
    Code:
    set flasher="%ProgramFiles%\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe"
    set binary=build\maple_boot.bin
    
    %flasher% -c SWD -P %binary% 0x08000000 -V
    pause
    Porting libmaple to a new CPU family and a new board is not done in 5 minutes, so it is not very surprising you have some problems with that. I have not started with porting the USB stuff, yet, so you should have a TTL2Serial converter to make use of what I currently have.

  7. #7
    Senior Pilot
    Join Date
    Mar 2010
    Posts
    161
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    libmaple doesn't play nice with the periph drivers from ST due to redefinitions but those are just warnings instead of errors

    what should be a good strategy? try porting libmaple? switch to using ST's drivers? Use ST's drivers for initialization and then call application code written with libmaple? Compile ST's drivers and libmaple into archived libraries?

    I just got some LEDs to blink using ST's drivers, USB is still a long way to go, I got the latest ST USB CDC class core to compile after a few hours, but it won't enumerate
    Last edited by frank26080115; 11-07-2011 at 12:03 AM.

  8. #8
    AeroQuad Core Software Developer ala42's Avatar
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    1,788
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    13
    I have already ported libmaple well enough to run the AQ code on my F4. Have not checked SPI yet, ADC is new but should be easy. USB will be fun

  9. #9
    Senior Pilot
    Join Date
    Mar 2010
    Posts
    161
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Is your code somewhere you are willing to show me?

    I got USB CDC enumerated!!! that took a lot of work. I still don't know how to send or receive anything yet, I'm working on it.

    It looks like I'm forced to use 144 MHz instead of 168 because 168 doesn't divide down to the 48 MHz USB requires, that also means the APB are 72 and 36 MHz again, which is good since now our peripheral code shares the same clock speed

    edit: I've posted the problems I'm having here https://my.st.com/public/STe2ecommun...currentviews=0

    ST's website sucks
    Last edited by frank26080115; 11-07-2011 at 06:10 AM.

  10. #10
    AeroQuad Core Software Developer ala42's Avatar
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    1,788
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    13
    Looks like you do not use the clock calculation tool. See the attached file for 168MHz with 48MHz USB clock.
    I send you libmaple later today after some cleanups.
    Attached Files Attached Files


 
Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •