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.

Sigma7's Content

There have been 7 items by Sigma7 (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#52378 Netduino 2 WITHOUT firmware...

Posted by Sigma7 on 26 August 2013 - 09:34 PM in Netduino 2 (and Netduino 1)

Nevermind/SORRY...

 

I'm still confused.. but after a dozen or so attempts.. it actually worked!  Sorry for "crying wolf" (though I'm completely at a loss to explain why it didn't work the first N-1 times).

 

Tom




#52376 Netduino 2 WITHOUT firmware...

Posted by Sigma7 on 26 August 2013 - 09:07 PM in Netduino 2 (and Netduino 1)

I have played around with several Netduino types (Netduino Mini, Netduino (1), Netduino Plus and Netduino 2)...

 

On the Netduino 2, I power it up with the button (BTN) held down (and Windows thinks the USB device is a "STM32FBOOTLOADER").  Then I'm able to download my firmware with STM's "DfuSe Demo (v3.0.3)" program.  This has worked fine for three Netduino 2's that I've gotten over the past year.  But I just ordered/received another one.. and the DfuSe download/upgrade seems (?) to work fine... but I can't get any response for the Netduino 2.  Any thoughts on what I can try?

 

(The firmware I'm downloading is an extremely simple boot monitor (command interpreter) that uses USART2.  And I use an ADAfruit 954 USB-to-TTL cable on Digital I/O pins 2 (RX) and 3 (TX).)

 

Thanks,

 

Tom




#49990 Netduino 2 "bare metal" startup...

Posted by Sigma7 on 26 May 2013 - 01:50 PM in Netduino 2 (and Netduino 1)

ziggurat29,

 

I was trying to bootstrap myself by following the "recipe" from Geoffroy Brown's "Discovering the STM32 Microcontroller" (chapter 5) (which is written for the STM32F100.. but I compared datasheets and changed registers and values as appropriate (e.g., the RCC A[H|P]B#ENR bits are all different).  His "example" SEEMED to be complete (albeit in bits an pieces) in that it started from the STM being reset, deals with initiializing the RCC, GPIOs, and USART, and ends with characters being written to the USART.  But I'm learing that there are pieces not included in the sample code (for example, setting up the clocks in the RCC).  So I'll have, hopefully, some time this weekend to play around with the N2.. and I'll let you know (by way of a reply.. or more questions) how it's going.

 

Regards,

Tom




#49944 Netduino 2 "bare metal" startup...

Posted by Sigma7 on 24 May 2013 - 08:49 PM in Netduino 2 (and Netduino 1)

ziggurat29,

 

Thanks.  And yes, I checked that it IS set.

 

The reset vector points (ignoring the LSB) to a single C-function (within which, everthing's a branch).  I'm trying to crawl before walking.  But I'm missing somthing simple/fundamental.




#49942 Netduino 2 "bare metal" startup...

Posted by Sigma7 on 24 May 2013 - 08:13 PM in Netduino 2 (and Netduino 1)

I have been working with Netduino Mini, Netduino 1 and Netduino Plus..  so I thought I'd try doing some Cortex-M3 "bare metal" programming on the Netduino 2 (N2).

 

I power-up the N2 with the pushbutton pushed, so the "STM32F2BOOTLOADER" gets invoked (and I'm able to upload/download files to flash with the STM DfuSe tool).  So far so good.

 

The GNU ARM toolchain I was using didn't support "-mcpu=cortex-m3 -mthumb."  So I grabbed the latest and greatest YAGARTO release.  Now things seem to build okay.

 

The binary file I download to flash (08000000) basically looks like:

 

0: 2000 e000

4: 0800 0021

 

20: <my program>

 

"My Program" basically does (all I'm trying to do is to print a character to the serial port (USART2)):

 

Enable USART2 in RCC_APB1ENR

Enable PIOA in RCC_AHB1ENR

 

for the USART2_TX pin (PIOA pin 2 Alternate Function 7)..

 

GPIOA_MODE(pin 2) = GPIO_MODE_AF

GPIOA_OSPEED(pin 2) = GPIO_SPEED_50MHz

GPIOA_OTYPE(pin 2) = GPIO_OTYPE_PUSHPULL

GPIOA_PUPDR(pin 2) = GPIO_PUPDR_NOPULL

GPIOA_AFRL(pin 2) = 7

 

the I setup the USART (USART2)

 

I set it up for 8-bits, no parity, 1 stop bit, no hardware flow control, and 38400 baud (which translates to DIV_Mantissa = 0x30 and DIV_Fraction = 0xd).  I enable the transmitter (CR1.TE) and receiver (CR1.RE).. then enable the USART itself (CR1.UE).

 

Then I just go into a loop, outputting a character as soon as the USART STATUS.TXE goes to 1.

 

I have one specific question, and one general one:

 

(1) When I look at the "Reset Sequence" in "The Definitive Guide to the ARM Cortex-M3" (pp. 44-46), it says that the reset vector should have its LSB set to 1 (for thumb).  Sounds reasonable, but I've seen many other reset examples that don't mention that at all.  Is "The Definative Guide" right on this?

 

(2) I know it's just pseudo-code, but does anything strike anyone as a glaring omission and/or mistake?

 

Thanks,

 

Tom

 

 




#48688 USB To Serial Question

Posted by Sigma7 on 24 April 2013 - 12:58 PM in Netduino Mini

Update...

 

Adafruit makes a "USB Console Cable #954" (a.k.a. "USB-to-TTL Serial Debug Cable") (Newark part 44W3509) that goes for $9.95.  In addition to being low-cost, it also brings out the USB's +5V which you can use to power the Netduino Mini.  It makes the "pay-to-play" price for the Mini about $40 ($30 for the Mini and $10 for the cable).

 

I used to use a Parallax "Board of Education" (serial or USB versions), but they're pretty pricey ($70 for the board alone, and $100 if you want to get it with a BASIC Stamp 2 module).

 

The only issue with the #954 cable is that your firmware needs to use USART0 (instead of the DBGU).  I hook it up as follows:

 

[font="'courier new', courier, monospace;"]AT91SAM7X512 Netduino Mini  Adafruit 954[/font]

 

[font="'courier new', courier, monospace;"]TXD0 PA1(A)   TX0  DIP 11   white[/font]

[font="'courier new', courier, monospace;"]RXD0 PA0(A)   RX0  DIP 12   green[/font]

[font="'courier new', courier, monospace;"] 5V DIP 21   red[/font]

[font="'courier new', courier, monospace;"] GND  DIP 23   black[/font]

 

[font="arial, helvetica, sans-serif;"]Regards,[/font]

 

[font="arial, helvetica, sans-serif;"]Tom[/font]




#47404 Beginner question

Posted by Sigma7 on 20 March 2013 - 02:04 AM in Netduino Mini

By the way...

 

The Basic Stamp 2 (BS2) can source/sink 20/25mA per PIO pin.. but only 40/50mA TOTAL (for 8 I/O pins) (per BS2).

The AT91SAM7X512 can only source 8mA per PIO pin.. but 200mA TOTAL.

 

Tom





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.