Code and dev environment

News, Setup, Compiling, Flashing, Development

Re: Code and dev environment

Postby paul_l_curtis » Fri Nov 30, 2012 11:19 pm

As Steve Jobs would say, "Just one more thing...."

Although I write CrossStudio, CrossWorks libraries, and so on, I would also say that I like developing my own code too. I suspect none of you are aware that I coded all the software in SolderCore project:

http://www.soldercore.com (Apparently I'm allowed to insert links now!)

To that end, as well as the SolderCore main board, we were very early in the queue for the MPU-6050:

http://soldercore.com/products/sensecore/corempu/

And then, I wrote an attitude and heading reference system and endowed CoreBASIC with quaternions:

http://soldercore.com/manual/corebasic_ahrs_driver.htm

That driver will fuse /any/ accelerometer, gyro, and magnetometer into an AHRS. The CoreMPU has all that, and then I demonstrated the sensor fusion by doing some 3D stuff all on the SolderCore's Cortex-M3:

http://www.youtube.com/watch?v=woR53WxH ... r_embedded

This doesn't use the MPU-6050's DMP to do sensor fusion, it's all done by the Cortex-M3. And the 3D calculations. And the drawing.

The next thing to do is get the quad off the ground using my own software. I just love writing software...

So, I do have a common interest which is how I sort of stumbled around here. :-)
paul_l_curtis
 
Posts: 5
Joined: Tue Nov 27, 2012 1:28 pm

Re: Code and dev environment

Postby srinath » Sat Dec 01, 2012 1:15 am

Paul

Suppose you had a fairly large piece of code that you wanted to map out like AQ.
How would you go about it? Would you stick with grep or are there special tools out there that could be used perhaps in combination with crossworks?
srinath
 
Posts: 1028
Joined: Mon Jun 25, 2012 5:47 pm

Re: Code and dev environment

Postby kinderkram » Sat Dec 01, 2012 9:23 am

Wow, Paul!

Amazing stuff you're working on. Welcome to the club.
You know ... getting quads off the ground is our domain. ;)

If we can do something for you - just ask for it.
kinderkram
 
Posts: 2911
Joined: Fri Jun 22, 2012 7:47 am

Re: Code and dev environment

Postby paul_l_curtis » Sun Dec 02, 2012 12:24 pm

srinath wrote:Paul

Suppose you had a fairly large piece of code that you wanted to map out like AQ.
How would you go about it? Would you stick with grep or are there special tools out there that could be used perhaps in combination with crossworks?


Well, I have a large piece of code, and all I can tell you how I map out my code. I break things into separate projects if I can, so I happen to have library projects for mass storage, TCP, low-level hardware drivers for my chips (Stellaris in my case, UARTs and so on), high-level drivers (e.g. for accelerometers, gyros). My application then brings in the services from those libraries and ties everything together.

The sources in each project are put into a single directory and then grouped logically using project system folders. This helps others coming into the project to show the logical grouping of the sources (I have folders such as Public API hacing client-side headers, Private API for internal interfaces in the library, Implementation for the C sources themselves, and then underneath that things such as Environmental, Motion, Temperate, Opto to class sensors, for instance, and for the networking, TCP, UDP, DNS so people can find what they need).

For searching, I put a number of features into CrossWorks that help me. Clearly there's single-key shortcuts to search the entire solution for a string under the cursor, or for finding references to an identifier. The symbol browser shows you what's linked into your app, the Source Navigator presents classes and functions and variables in the solution.

I also put in some things to make access to sources fairly quick, wherever they are. So, Ctrl+O will open a file in the solution, wherever it is, with integrated search.

Do I use grep? Yes, sometimes, but my most-often-used keystroke for finding is Alt+U to find the identifier under cursor wherever it occurs in the program. That, with the Waypoint feature and the list of finds, is a great way of navigating.

I have to hold my hands up and say I absolutely hate Eclipse. I have to use it for some programming I do on XMOS devices, and I hate every moment using it.
paul_l_curtis
 
Posts: 5
Joined: Tue Nov 27, 2012 1:28 pm

Re: Code and dev environment

Postby Shogun » Thu Dec 20, 2012 4:00 pm

Hi,

following the instructions in "Developing your own code : a short introduction" to compile the latest revision I get the error:
bad value (cortex-m4) for -mcpu= switch

What do I have to do, how to continue?

Edit: OK, solved, for Cortex-M4 support at least crossworks 2.1 release is necessary.
Shogun
 
Posts: 46
Joined: Tue Aug 14, 2012 10:53 am
Location: Aachen, Germany

Re: Code and dev environment

Postby skew » Wed Feb 06, 2013 3:51 am

Just a heads up anyone using the Makefile for Linux from this thread. getbuildnum.o needs to be added to it to compile firmware past R71


Code: Select all
ppm.o esc32.o getbuildnum.o
skew
 
Posts: 181
Joined: Sun Oct 14, 2012 1:30 am
Location: Morehead, Ky

Re: Code and dev environment

Postby Max » Wed Feb 06, 2013 12:47 pm

Thanks for pointing that out! I've been neglecting the Makefile here :oops:

Here's an updated version for latest firmware. New option to set hardware version, auto-increments the build number in buildnum.h (can be disabled), automatic bin file naming based on firmware and board version, and a few other options & changes.

LMK if any issues.

-Max
Attachments
AQ-Makefile-020613.zip
(3.47 KiB) Downloaded 200 times
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: Code and dev environment

Postby afernan » Tue May 07, 2013 4:00 pm

@Max:
I´m trying to compile with the makefile in trunk r106. I have the three folders together (mavlink, onboard, STM32). I´ve found two problems:

1.- I can´t find the file "STM32f4.ld", that should be with STM32 folder from CW at location (in my win7):
C:\Users\AFD\AppData\Local\Rowley Associates Limited\CrossWorks for ARM\packages\targets

2.- doing a "make" I found following error (se image attached)
File "1wire.c" I guess is in the right place (under "onboard")

Any idea?
thanks

Angel
Attachments
New Picture.jpg
New Picture.jpg (57.25 KiB) Viewed 4810 times
afernan
 
Posts: 1214
Joined: Sat Jul 07, 2012 5:24 pm
Location: Madrid, Spain

Re: Code and dev environment

Postby Max » Tue May 07, 2013 5:19 pm

Hi Angel,

You don't have the .ld and .s files in the STM32 folder? I thought I got it from the d-load on the German forum... oh I see that file's not up anymore. The contents of the STM32/include I think come from STM (I have some with my discovery board download), but the .ld and .s I think are from Rowley (although I can't find them on my computer in any CW folders). I attached a copy of the original file from the other forum here (with the STM32 folder)... hope it's OK.

The compile error I think means it can't create the Release/obj/ folder (check if that exists), or perhaps it can't find the source folder at all for some reason. 1wire.c is simply the first file it tries to build.

Let me know if you still have issues...

-Max
Attachments
aq-makefile.tgz
(298.79 KiB) Downloaded 169 times
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: Code and dev environment

Postby afernan » Tue May 07, 2013 8:25 pm

Hi Max:
thx for your help. Using your files now. I get the following:

"Fatal error: stm32f4xx.h: no such file or directory"

I see in the makefile that the includes path is correct (I think)
INCLUDES = -I. -I./STM32/include etc...

Attached are the files I´m using. I have a CW folder copied under C:\
Attachments
arm-gcc.zip
(924.79 KiB) Downloaded 173 times
afernan
 
Posts: 1214
Joined: Sat Jul 07, 2012 5:24 pm
Location: Madrid, Spain

PreviousNext

Return to AQ Firmware

Who is online

Users browsing this forum: No registered users and 1 guest

cron