Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

knutolai's Content

There have been 36 items by knutolai (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#50108 Environment and Compiler for building STM32f2xx-based projects

Posted by knutolai on 30 May 2013 - 12:15 PM in General Discussion

So I ran into some trouble with ODeV when writing a program where I combine C and C++. 

 

I keep getting "expected '=', ',', ';', 'asm' or '__attribute__' before '*' token" when building. ODeV does offer a C++ extension (FreeRTOS_EC) and there is a downloadable project for a STM32F1xx device using this extension (Cortex_STM32F1xx_CPP_Template).

 

I added FreeRTOS_EC as a Linked Resource in my project, but it didn't really do any difference. When further inspecting and comparing  the preferences of the I noticed that both projects used the same Tool Chain with the same Used Tools. However only the F1xx project has the C++ Compiler (ARM Sourcery Windows GCC C++ Compiler) listed in the Discovery Options Tools list. 

For some reason my project does not understand that it needs this compiler to build the code. 

 

I tried applying all available discovery profiles, but none of them adds the C++ Compiler to the tools list

 

Does anyone have any suggestions on other things I could try? 




#50036 DFUSE troubleshoot

Posted by knutolai on 27 May 2013 - 08:43 PM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]OMG (sigh) yes I should have mentioned that, too; I forgot about the update tool version issue.  I know folks have had problems with the earlier version (and hence why Chris put a link to the working ones, because they are harder to find otherwise).  And I am apparently using 3.0.1 and 3.0.2 myself, according to the title bar text.[/color]

That did the trick! I imagined v. 3.0.0 was a stable working version (mostly because of the naming). 

 

Thank you very much for the help! Now I can finally start testing my code! 




#50011 DFUSE troubleshoot

Posted by knutolai on 27 May 2013 - 09:18 AM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;] (which is better than where you are now, right?  which is ground negative x?)[/color]

Haha yeah agreed. 

 

I found the .dfu in the thread. Thank you. Tried to flash it onto the board following the steps in the thread. I got the same result as stated above. I'm using version 3.0.0 of DFUSE. The thread asks for version 3.0.2 and 3.0.1. Could this be vital to how the program runs? 

 

I'm sure DFUSE and my computer recognizes that my Netduino 2 is in bootloader mode. The upgrade option in DFUSE Demonstrator is grayed out when I attach it while not pressing the reset button. I'm a bit vary of using the DFUSE tools in any other ways than suggested in the thread, but could I try the "Upload Action" pane in DFUSE Demonstrator? It lets me upload a .dfu file (instead of upgrading(?), a little confusing). I don't wanna reach a point of no return with my board 




#49988 Environment and Compiler for building STM32f2xx-based projects

Posted by knutolai on 26 May 2013 - 11:23 AM in General Discussion

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Yes,you can use the elf file with GDB for debug.[/color]

Or you can use below command to generate .hex file for burning(using st-link utitily or something similar)

arm-none-eabi-objcopy.exe -O ihex Yourfilename.elf Yourfilename.hex

Great that worked alright. Again thank you so much for the link to ODeV! Amazing resource :)




#49987 DFUSE troubleshoot

Posted by knutolai on 26 May 2013 - 11:21 AM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]*  is the DFU valid?  not only valid as a dfu, but when you built it, does it have what you think it does.[/color]

The .dfu file is generated from a .hex file, again generated from a .elf file I get when I build my project. 

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]*  did you first erase the device?  with the stdfu tester?[/color]

Yes I always erase the board using the steps in the provided link. I think the board-erasing-process is working as that actually takes a few seconds to complete. The tool also states something like "erasing complete/successful" so I'm fairly confident this step is done correctly. 

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]*  did you select the 'verify' option, so the that it will read back what you wrote? (this is particularly useful to make sure you didn't forget to first erase)[/color]

When I select 'Upgrade' I get "Target 00: Upgrade Successful" (after upgrade that takes 0 seconds to complete)
When I select 'Verify' I get "Target 00: "Verify Successful". Im not shown by DFUSE what was written to the device. 

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Lastly (and I should have mentioned it firstly), try to flash the official firmware to verify your understanding of the flashing tool.  Then, if you have problems, you can be fairly confident that something is awry with the dfu itself (or with the contents therein).[/color]

Thats a great idea. I can't find the Netduino 2 firmware in a .dfu format. I found the firmware .zip file here: http://www.netduino.com/downloads/. I don't know how to use the content however as there is no README file provided. Could anyone supply me with either a firmware in the .dfu format or steps on how to generate it from the resources in the .zip file? 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]What OS are you using?[/color]

IIRC, only some versions work on XP.

And, as always, run the program as admin if you're not already on an admin account.

I'm working in Windows 7 Home Premium. I'm the system admin. 




#49945 DFUSE troubleshoot

Posted by knutolai on 24 May 2013 - 09:00 PM in General Discussion

DFUSE Demonstration is acting strangely. I wish to upload a firmware to my STM32f2xx chip based on the chips standard library. 

 

I follow the steps for firmware update found here:

http://forums.netdui...-v422-update-2/

 

When I hit the "upgrade" key in DFUSE Demonstrator, having chosen the .dfu file I wish to flash onto the board, the upgrade process takes 0 seconds to complete and I get a error message when leaving .dfu mode. The program I attempted to upload has no effect on the board. 

 

Is this a safe indicator that the .dfu file I attempted to upload is incompatible or unrecognizable by the board? 

Is there any magical way of operating DFU File Manager? 




#49909 Can STDFU erase MCU embedded bootloaders?

Posted by knutolai on 24 May 2013 - 11:31 AM in General Discussion

Ok good to know. It also makes a lot of sense I guess. 

 

DFUSE Demonstration is acting strangely. I follow the steps for firmware upgrading and when I hit the "upgrade" key, having chosen the .dfu file I wish to flash onto the board, the upgrade process takes 0 seconds and I get a error message when leaving .dfu mode. The program I attempted to upload has no effect on the board. 

 

Is this a safe indicator that the .dfu file I attempted to upload is incompatible or unrecognizable by the board? 

 

EDIT: This is being discussed in a separate thread (http://forums.netdui...e-troubleshoot/)




#49907 Environment and Compiler for building STM32f2xx-based projects

Posted by knutolai on 24 May 2013 - 11:19 AM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]obviously you made some mistake while setting up the eclipse.[/color]

Thats what I thought to. Thank you for the link to ODeV.

I've installed the package and it manages to compile the template project, generating a .elf file. Does this file contain the whole pre-compiled project? 




#49787 Environment and Compiler for building STM32f2xx-based projects

Posted by knutolai on 22 May 2013 - 06:09 PM in General Discussion

Hi

I'm building a simple C program based on the STM32F2xx peripheral library examples. The program is meant to flash the onboard LED on my Netduino board. 

 

I've set up a environment using:

Eclipse Juno C/C++

GNU ARM Eclipse plugin (CDT)

LaunchPad GNU Tools for ARM (has Cross GCC compiler)

 

I'm working in a 64-bit windows 7 system. 

 

I build the project in Eclipse and keep getting the error:

Make: *** [<project name>] Error 1

 

I can't afford to buy a commercial tool. Does anyone have any recommendations on alternatives I could try out?

 

I have checked out CooCox CoIDE, but it only supports projects for STM32F1/F4 MCUs. I've also tried building the project in the command-line (though I might have used faulty syntax, as I have absolutely no experience with it).

 

attached is my main program (was not allowed to upload .h and .c files)

Attached Files




#49348 Linking MCU startup file / DFU flashing issue

Posted by knutolai on 11 May 2013 - 12:01 AM in General Discussion

Quote
Quote
[color=rgb(40,40,40);][font="helvetica;"]iam using coocox as ide, and the newest arm gcc from launchpad.[/color][/font]

Nice, free stuff! :) I'll give them a try. Coocox has compitability with STM32F1xx and F4xx chips. Should probably be a close enough fit for my F2xx device.

Edit:
I was able to import and replace library and core files to the project. However when a new project is created one has to chose a chip. Does this, on the functionality of the IDE, go beyond the libraries the IDE provides/suggests?

Edit2:
I might have found working setup using GCC Tools ARM Embedded, Eclipse, GCC Make and CROSS ARM GNU Plugin. Links:
http://sourceforge.n.../gnuarmeclipse/ CROSS ARM GNU Plugin

http://gnuwin32.sour...ckages/make.htm GCC Make (place "make.exe", "libiconv2.dll", "libintl3.dll" in compiler path.
https://launchpad.net/gcc-arm-embedded GCC ARM compiler



#49336 Linking MCU startup file / DFU flashing issue

Posted by knutolai on 10 May 2013 - 03:01 PM in General Discussion

I'm having trouble getting my MCU to understand the pre-compiled code I flash onto it. Im using the STM32F2xx standard peripheral libraries which comes with some example projects as well as a template for creating your own projects. I'm using a MINGW GCC compiler. Running in the 'cmd' screen (windows 7). I manage to compile my test-project, though I had to move certain library files around to make it work. 
 
I suspect that there is a issue with the 'startup_stm32f2xx.s' file which is supposed to configure clock settings for the microcontroller. 
From main.c of standard peripheral template:
 

 

int main(void) {
/*!< At this stage the microcontroller clock setting is already configured, 
this is done through SystemInit() function which is called from startup
file (startup_stm32f2xx.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_stm32f2xx.c file */
...
 
How would I go about linking the start-up file to my project? I have one which is supposed to work with gcc. It says "gcc_ride7" in the file directory, but I can't seem to find a line of code linking it to the project. 
 
There might also be a issue with the way I compile my code. I compile writing "gcc main.c" which produces a .exe executable file. DFUSE allowes me to convert this into a .dfu file. When I attempt to flash this onto the board, after erasing the board, the loading-bar finishes in half a second. When I reconnect the board, leaving bootloader-mode, the uploaded code has no effect on the board.
I highly doubt my code is faulty as it is strictly based on one of the example projects designed for the STM32F2xx MCU.  
 
Does anyone have suggestions on things I could try out? 



#49320 C++ project ADC and PWM setup suggestions

Posted by knutolai on 10 May 2013 - 12:43 AM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]OMG right you are.  Those pins are used for the ethernet on NP2, and they're NC on the N2.  Pity, because the DAC can be run from DMA (as can the ADC), leaving your processor free to...  Process![/color]

Have you made any such applications? This is my first project and what I have to back me up codewise is a set of example codes showing different functionality. In the case of ADC input run from DMA. where and how do I read the input data? Im feeling rather incompetent :S

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]be sure to journal it as you go and blog it if you can![/color]

Hopefully the project will end as a rapport and demonstration. Ill try have a English version online sometime this summer I get stuff working. I'll be sure to post a link in this thread. 




#49280 STM32F2xx Manual - Understanding GPIO register tables

Posted by knutolai on 09 May 2013 - 09:26 AM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Remember I talked about clearing the bits before setting them, well you would use something like the following to clear them:[/color]

Would it be a option also just to reset a given register and overwrite it afterwards?

 

like

GPIOA_MODER = 0x00; // reset

PGIOA_MODER |= <some value here>; // set register as wanted




#49246 Programming the Netduino using Native Code (?)

Posted by knutolai on 08 May 2013 - 06:17 PM in Netduino 2 (and Netduino 1)

[color=rgb(40,40,40);][font="helvetica;"]
Could STDFU/DFUSE potentially erase/ruin the embedded bootloader when erasing the Netduino 2 firmware?[/color][/font]
[color=rgb(40,40,40);][font="helvetica;"]
As you said STDFU erases the content of the MCU flash memory. Is there any code accompanying a on-chip bootloader necessary for it to function? Also, where would this code be stored? Is there a risk such code would be erased when erasing the board, and/or when flashing binaries onto the board?[/color][/font]
Im worried that STDFU will (sort of) self destruct by erasing the bootloader software on the chip. Leaving me with a un-flashable board.

Edit: Question was answered someplace else. STDFU is not able to erase the embedded bootloader as it is stored in a seperate non-erasable ROM.



#49238 Can STDFU erase MCU embedded bootloaders?

Posted by knutolai on 08 May 2013 - 04:21 PM in General Discussion

Can STDFU/DFUSE erase/ruin the embedded bootloader when erasing the MCU firmware?

 

Im using a STM32F2xx MCU with a embedded bootloader. The way I have understood it, STDFU is able to erase the content of the MCU flash memory, letting you for instance remove such things as the .NET firmware of a Netduino board.

 

Is there any code accompanying a on-chip bootloader necessary for it to function? Also, where would this code be stored? Is there a risk such code would be erased when erasing the board, or overwritten when flashing binaries onto the board (say for instance if the program is great in size)?

 




#49147 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 07 May 2013 - 10:20 AM in Netduino Plus 2 (and Netduino Plus 1)

I found a possible solution in Eclipse:

https://sites.google...ery-development

I'll post a update if I find that it works

 

Edit: I got a MINGW gcc compiler through the Sourcery CodeBench Lite Edition. Editing the code in Visual Studios and running it through the terminal (typ. 'gcc main.c') stuff seem to work though it has trouble finding some of the include files. Seems the 'standard peripherals library'-packages folder architecture is designed for very specific compilers... 




#49095 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 06 May 2013 - 01:22 PM in Netduino Plus 2 (and Netduino Plus 1)

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]If you use the standard templates...you're basically just create your application on top of it.[/color]

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]BTW, the standard templates should in theory set up the microcontroller for you: clocks, power, etc.[/color]

That's great to hear Chris!

I'm currently coding my project in Microsoft Visual C++ 2010 Express and the built in compiler seems to have trouble understanding the core_cm3.h system file. Scrolling to line 737 it seems the code wants to be compiled with either a ARM, GNU, IAR or TASKING compiler. 

So I'll be searching for a new compiler to run and troubleshoot my program. Is anyone aware of a favorable compiler/toolchain among these? I'm working in a Windows 7 OS. 




#49094 C++ project ADC and PWM setup suggestions

Posted by knutolai on 06 May 2013 - 01:11 PM in General Discussion

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]*  you know the Netduino 2 has an M3 core, and the Netduino Plus 2 has an M4.  You might like the M4 better, since you'll get the DSP instructions, and a floating point processor.  Maybe those will be useful depending on what kind of processing your effects will involve.[/color]

I'll have to look into that in the future! However the timeschedule for my project woun't let me sit around and wait for a Netduino Plus 2 board. 

 

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]*  both of those chips have a DAC.  maybe that will be more handy than the PWM, which would would need to pass through an integrator to make it analog anyway.[/color]

I'd really like to use the DAC however the pins where it can be accessed is not connected to the Netduino 2 boards shield pins (the blue junctions around the edge of the board). Honestly I think the PWM should work fine as long as I manage to set it up right. I've already built the analog circuit to accommodate the Netduino board with a integrator for the PWM-stream. I'll share the schematic if people are interested. It's not a perfect design however. 




#48980 C++ project ADC and PWM setup suggestions

Posted by knutolai on 03 May 2013 - 12:39 PM in General Discussion

Hi 

Im designing my first C++ based project. I'm using the STM32F205 MCU (Netduino 2) and need some suggestion on ADC-input and PWM-output config/setup. I noticed both ADC and PWM has many different possible configurations and I'm having a hard time deciding how to configure them. I've found project examples that to some extent cover both, but again, a lot of different config options.

 

Hopefully someone can point me in the right direction for the config as I find the amount of options quite overwhelming (for ADC interrupt generation, interleaved more, dual/triple mode, continuous conversion mode etc., for PWM edge-aligned mode, center-aligned mode, 6-step PWM gen., one pulse mode etc.). 

 

STM32F2xx manual can be found here: http://www.st.com/st.../CD00225773.pdf

 

What I'm building is a digital guitar effect pedal, that does real-time DSP. 

The project I'm building will have four ADC channels. The ADC will read input data continuously, and the data is not meant to be saved, as the system does real-time processing only. 

Three of the ADC channels will read control-signals (potentiometers), meaning they do not require a high samplerate (ADC reading speed). I'm thinking 1kHz or more. Full ADC bit-depth (12-bit) is necessary. 

The last ADC channel is meant to read a input audio-stream. This channel will need to have a high samplerate (Im thinking 96kHz or higher). Full bit-depth is necessary.

The four input signals are connected to PC1, PC3, PC4 and PC5 of the chip, PC1 being the audio input. I was thinking I could use ADC1 or ADC2 for all four inputs, and multiplex between the different ADC channels using "Channel-wise programmable sampling time" (p. 212) to give PC1 a higher samplerate than the others. 

 

The project will have one PWM output. I'll be using Timer 8 (TIM8), assigned to PC7. The PWM output is meant to generate waveshapes. The PWM should be configured for a bit-depth of 12 or 16 and the samplerate of the PWM stream should be equal and in sync with the samplerate of the ADC channel connected to PC1. I would achieve this with one of the basic timers (TIM6 or TIM7 p. 463) or a interrupt routine (any suggestions on this?)

 

Hopefully this says something about the mode to which I should configure the ADC and PWM. 

Any and all response is greatly appreciated! 




#48773 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 26 April 2013 - 05:24 PM in Netduino Plus 2 (and Netduino Plus 1)

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]This should help you get started:[/color]
http://www.st.com/we.../tools/PF257904

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:14px;]I found v. 1.0 of the standard peripherals library for the STM32F2 here:[/color]
https://my.st.com/pu...rrentviews=3498    

Does these also work as a general purpose C++ firmwares? I would imagine when STDFU erases the .NET netduino firmware I would need a new firmware in order for the MCU to understand my code. Am I correct on this? I'm fairly new to hardware programming and it seems a little overwhelming to write a full firmware for the MCU as well as the actual program I want the chip to run. 




#48729 STM32F2xx Manual - Understanding GPIO register tables

Posted by knutolai on 25 April 2013 - 01:10 PM in General Discussion

Thanks this helps a lot!  Here '|=' works like a bitwise '+=' right? 




#48723 STM32F2xx Manual - Understanding GPIO register tables

Posted by knutolai on 25 April 2013 - 11:03 AM in General Discussion

Hi 

Im learning to program a Netduino 2 board in C++ and I'm having a hard time understanding certain parts of the STM32F2xx MCU manual:

(http://www.st.com/st.../CD00225773.pdf).

(I was unsure where to post this topic. The STMicroelectronics requires a company name, and I'm just a student. I apologize if this was posted in the wrong subforum.) 

 

Page 146 - 151 of the Manual describes the MCU GPIO register. I'm quite new to MCU's and the manuals terminology and I don't quite understand how to read the section 6.4.1 as well as the following sections. 

 

First of: In the table what does 'rw' mean and what does the syntax [1:0] (in lines such as MODER[1:0]) and the numbers 31 to 0 above the table represent?

 

Also could anyone explain the line "Bits 2y:2y+1 MODERy[1:0]: Port x configuration bits (y = 0..15)"? (first line beneath the table). The way I read it if I for instance would want to configure PA0 of the GPIO to analog mode I would write:

 

GPIOA_MODER0 = 0b11;   // sets PA0 to analog mode

 

Have I misunderstood the concept completely? And if so, as a example, what would be the right syntax for setting the pin PA0 to analog? 

 




#48685 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 24 April 2013 - 10:09 AM in Netduino Plus 2 (and Netduino Plus 1)

No, Netduino gen 2 have different microcontroller, STMicroelectronics STM32F4.

According to the Netduino website (http://netduino.com/...uino2/specs.htm) the Netduino 2 uses a STM32F2 series MCU. 

 

The Netduino 2 Plus and the Netduino Go uses a STM32F4 series MCU.

 

Just in case.. ;)

 

Are you aware of any major differences between F2 and F4? There seems to be a lot more tutorials and example code covering the F4 then the F2.




#48657 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 23 April 2013 - 01:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Something else I noticed when comparing the Netduino schematic and the STM32F4 datasheet (both found here http://netduino.com/...uino2/specs.htm) is that the stated functionality of each pin is expanded when the .NET firmware is removed (?). For example some of the digital pins has ADC functions and more digital pins has PWM functions than stated (see page 39 and onward in the datasheet and compare the pins to the schematic pinout). 




#48655 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 23 April 2013 - 12:37 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks a lot! 

I found v. 1.0 of the standard peripherals library for the STM32F2 here:

https://my.st.com/pu...rrentviews=3498





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.