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 20-May 23)


By content type

See this member's


Sort by                Order  

#48245 Programming the Netduino using Native Code (?)

Posted by knutolai on 10 April 2013 - 03:32 PM in Netduino 2 (and Netduino 1)

Hello forum!

This is my first thread so please welcome me to the forum (:

I just got my new Netduino 2, installed NETMF and the STKs and uploaded the "blinking LED" program. So exciting! :D 

 

Now my purpose with getting the Netduino is realtime DSP of sound. I did some research around the forum and found this thread:

http://forums.netdui...l=+sound +input

 

The thread in short: (the way I understand it)

NETMF is not a very realtime friendly OS and to get the full potential from the Netduino (for realtime applications) the MCU should be programmed using native code.

 

So my question is are there any good resources on getting started with programming the Netduino using native code? Alternatively would anyone help a dude along with the first steps? I aim for a fast realtime system (which I get the impression, and hope, Netduino is able to deliver) programmed using C++

 

My background:

I'm a music technology student. I have some experience with Arduino, Python, C and Java as well as other higher level programs suited specifically for music production (Csound, Ableton, Pure data). I've built analog guitar effect pedals for the last 2 years springing my interest in building a digital effect pedal. 




#48248 Recompiling the firmware and accessing and changing register values from C#

Posted by knutolai on 10 April 2013 - 04:03 PM in General Discussion

I'm also interested in programming my NetDuino using native code (for sound DSP use). 

I haven't either been able to find any good resources though I found this thread where they speak about native coding as being not too difficult to achieve:

http://forums.netdui...l=+sound +input

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;] I fully understand that this render my device useless and I am willing to take the risk.[/color]

Why would this render the device useless? (I'm fairly new to MCUs)




#48249 Recompiling the firmware and accessing and changing register values from C#

Posted by knutolai on 10 April 2013 - 04:08 PM in General Discussion

Update:

Thought these sources could be interesting to you:

http://forums.adafru...php?f=8&t=19953

http://www.freertos.org/




#48250 Recompiling the firmware and accessing and changing register values from C#

Posted by knutolai on 10 April 2013 - 04:18 PM in General Discussion

Also:

http://forums.netdui...-c-on-netduino/ (sorry for repostig instead of modifying earlier posts, Im new and need approval from a moderator to have my posts shown)

 

This should cover everything you need to know:

http://wiki.netduino...-resources.ashx




#48256 Need help compiling C++ on Netduino

Posted by knutolai on 10 April 2013 - 07:35 PM in General Discussion

Sorry for reopening a old thread, but has any further progress been made on this project? 




#48260 Programming the Netduino using Native Code (?)

Posted by knutolai on 10 April 2013 - 08:19 PM in Netduino 2 (and Netduino 1)

Ok so I found this http://wiki.netduino...-resources.ashx awsome resource on the wiki page. I've started reading the toolchain setup tutorial. 

The steps of the process would be:

-Write a program in eclipse 

-Upload the program to the netduino using the Atmel SAM-BA (still inside eclipse(?))

 

SAM-BA is like a add-on of sorts to eclipse which allows me to upload code to this family of MCUs in particular? 

 

I see the language of native code (for NerDuino) being referred to as C/C++ does this mean object oriented programming or not? The way I understand it C++ is like "C, but object oriented and with more features". Can anyone clarify this for me? Its the only thing that's really confusing me at the moment

I somehow need to know if Im using the right syntax

 

Edit: I noticed the toolchain setup tutorial looks rather outdated (2007). I'm uncertain what I need to download to be able to native code the device (the tutorial asks me to download and install the toolpack YAGARTO. Im not sure what to download as the name has changed and the YAGARTO website offers several different downloads). Any help with this?




#48271 Programming the Netduino using Native Code (?)

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

 Hi and thanks for your reply!  :)

 

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]Or you can use DFUSE to flash your compiled binaries via USB.[/color]

So no MiniJTAG / [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]STLink/V2 hardware is really necessary? (Im working on a kinda tight schedule)[/color]

 

DFUSE is described as a firmware upgrade library (http://www.st.com/st...rchtype=keyword).

Im guessing Im supposed to reset the Netduino (3.3v connected to golden reset pad by D0). Would I need to upload the DFUSE firmware and/or any other firmware to the MCU in order to upload pre-compiled binary code using this method? 




#48295 Programming the Netduino using Native Code (?)

Posted by knutolai on 11 April 2013 - 10:59 AM in Netduino 2 (and Netduino 1)

Hi again!

 

I don't quite understand what DFUSE really is (though I have downloaded it). Is it a firmware or a program-uploading-application or both?

 

I found this thread on upgrading the Netduino 2 Plus firmware http://forums.netdui...-v421-update-1/

You here link to the STDFU Tester application. Is it part of the DFUSE program? I feel really stupid, but I cant find any good resources explaining DFUSE and STDFU. Could anyone give a simplified explanation? There are so many new things to get familiar with here  :lol:[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;] [/color]




#48313 Programming the Netduino using Native Code (?)

Posted by knutolai on 11 April 2013 - 10:21 PM in Netduino 2 (and Netduino 1)

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]DFUSE is a program designed to upload/download firmware to/from your board.[/color]

So my precompiled code uploaded by DFUSE would be considered as the firmware of the chip? When STDFU has erased the Netduino its left totally blank right? That is kinda cool :)

 

I found this 'getting started' manual on DFUSE: 

http://www.st.com/st...rchtype=keyword

Should probably cover the hardware setup and the rest of the process. Now to finish my program. Thank you for the good help and patience! It's highly appreciated! 




#48645 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 23 April 2013 - 11:13 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi forum

I found the wiki page with all the Native Code Resources (http://wiki.netduino...-resources.ashx)

It's here mentioned a package of Atmel tutorial codes (AT91SAM7X-EK code samples). Will these work for the second generation of Netduino Boards? The reason I have doubt is because the wiki page haven't been updates since 2011 and there is no mention of the second gen. Netduino boards. 

 

 




#48652 AT91SAM7X-EK Netduino 2 compatibility?

Posted by knutolai on 23 April 2013 - 11:42 AM in Netduino Plus 2 (and Netduino Plus 1)

Then are there any code snippets I can use as a basis if I want to write native code for a second gen. Netduino board? Is there any place where I can find board.h, pio.h and such that works with the STM32F4? Im kinda new to this. 




#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




#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). 




#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.




#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? 

 




#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? 




#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. 




#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! 




#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. 




#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. 




#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... 




#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)?

 




#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.



#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




#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. 





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.