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

Member Since 27 Mar 2012
Offline Last Active Sep 02 2013 06:02 PM
-----

Topics I've Started

Netduino 2 WITHOUT firmware...

26 August 2013 - 09:07 PM

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


Netduino 2 "bare metal" startup...

24 May 2013 - 08:13 PM

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

 

 


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.