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

Programming the Netduino using Native Code (?)

dsp audio realtime C++

  • Please log in to reply
8 replies to this topic

#1 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 10 April 2013 - 03:32 PM

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. 



#2 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 10 April 2013 - 08:19 PM

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?



#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 April 2013 - 08:44 PM

Hi knutolai, Since you have a Netduino 2, you're in a good position to write native code. If you solder a MiniJTAG header onto the 10 gold pins on the right edge of the board...you can even debug interactively! You'll upload your program from your preferred IDE (IAR Workbench, Eclipse, etc.) using the STLink/V2 hardware via MiniJTAG. Or you can use DFUSE to flash your compiled binaries via USB. You can use C code or C++ (object-oriented). Both are outside the scope of official support here on the forums, but there are quite a few native code hackers around here who would be happy to pitch in. Chris

#4 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 10 April 2013 - 10:09 PM

 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? 



#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 April 2013 - 10:55 PM

Hi knutolai, Netduino 2 is a second-generation Netduino, so it doesn't have an ERASE pad (although there's a circular fiducial there to guide the pick and place robots). To erase the board, you just use STDFU Tester following the erase instructions in the firmware upgrade threads. If you're writing native code for Netduino 2, I would really recommend using JTAG. That way you have a good way to debug and a fast way to reflash the board with small updates. But you're right...it's really not necessary. You can just compile firmware and the deploy it using USB (using STDFU Tester to erase and then DFUSE to flash). Chris

#6 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 11 April 2013 - 10:59 AM

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]



#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 April 2013 - 03:30 PM

Hi knutolai, It's okay, I haven't found any really good resources explaining STDFU and DFUSE either. They are both part of the DFUSE installation. They come together. STDFU Tester is a DFU diagnostics program which we use to erase Netduino gen2 boards. DFUSE is a program designed to upload/download firmware to/from your board. So the answer is: it can do both. Chris

#8 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 11 April 2013 - 10:21 PM

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



#9 knutolai

knutolai

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 08 May 2013 - 06:17 PM

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





Also tagged with one or more of these keywords: dsp, audio, realtime, C++

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.