Merge pull request #154 from martinayotte/master

Fix issues with arduino_uip library and other minor changes on STM32F4
This commit is contained in:
Roger Clark 2015-12-17 10:24:35 +11:00
commit bfd9e4e591
6 changed files with 23 additions and 22 deletions

View File

@ -30,13 +30,13 @@ void setup() {
Ethernet.begin(mac);
Serial.print("localIP: ");
Serial.println(Ethernet.localIP());
Serial.println(Ethernet.localIP().toString());
Serial.print("subnetMask: ");
Serial.println(Ethernet.subnetMask());
Serial.println(Ethernet.subnetMask().toString());
Serial.print("gatewayIP: ");
Serial.println(Ethernet.gatewayIP());
Serial.println(Ethernet.gatewayIP().toString());
Serial.print("dnsServerIP: ");
Serial.println(Ethernet.dnsServerIP());
Serial.println(Ethernet.dnsServerIP().toString());
next = 0;
}

View File

@ -4,7 +4,7 @@ email=Norbert Truchsess <norbert.truchsess@t-online.de>
sentence=Ethernet library for ENC28J60
paragraph=implements the same API as stock Ethernet-lib. Just replace the include of Ethernet.h with UIPEthernet.h
url=https://github.com/ntruchsess/arduino_uip
architectures=STM32F1
architectures=STM32F4
version=1.04
dependencies=
core-dependencies=arduino (>=1.5.0)

View File

@ -57,6 +57,7 @@ static byte selectPin;
void Enc28J60Network::init(uint8_t* macaddr)
{
uint32 timeout = 0;
MemoryPool::init(); // 1 byte in between RX_STOP_INIT and pool to allow prepending of controlbyte
// initialize I/O
// ss as output:
@ -100,8 +101,12 @@ void Enc28J60Network::init(uint8_t* macaddr)
#ifdef ENC28J60DEBUG
Serial.println("ENC28J60::initialize / before readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
#endif
while (!readOp(ENC28J60_READ_CTRL_REG, ESTAT) & ESTAT_CLKRDY)
;
while (!readOp(ENC28J60_READ_CTRL_REG, ESTAT) & ESTAT_CLKRDY) {
if (++timeout > 100000) {
Serial.println("ENC28J60::initialize TIMEOUT !!!\r\n");
return;
}
}
#ifdef ENC28J60DEBUG
Serial.println("ENC28J60::initialize / after readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
#endif

View File

@ -28,17 +28,12 @@
#include <SPI.h>
#include "mempool.h"
//#define ENC28J60_CONTROL_CS SS
//#define SPI_MOSI MOSI
//#define SPI_MISO MISO
//#define SPI_SCK SCK
//#define SPI_SS SS
#ifdef ARDUINO_STM32F4_NETDUINO2PLUS
#define ENC28J60_CONTROL_CS PC8
//#define SPI_MOSI PA7
//#define SPI_MISO PA6
//#define SPI_SCK PA5
//#define SPI_SS PA8
#else
#define ENC28J60_CONTROL_CS SPI.nssPin()
#endif
#define UIP_RECEIVEBUFFERHANDLE 0xff

View File

@ -32,7 +32,7 @@ compiler.define=-DARDUINO=
# this can be overriden in boards.txt
build.cpu_flags=
build.hs_flag=
build.common_flags=
build.common_flags=-mthumb -D__STM32F4__
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}
# These can be overridden in platform.local.txt
@ -125,10 +125,11 @@ tools.serial_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.alt
# STLINK/V2
tools.stlink.cmd=stlink
tools.stlink.cmd=stlink_upload
tools.stlink.cmd.windows=stlink_upload.bat
#tools.stlink.cmd.linux=
#tools.stlink.cmd.linux=stlink_upload
tools.stlink.path={runtime.hardware.path}/tools/win
tools.stlink.path.linux={runtime.hardware.path}/tools/linux/
tools.stlink.upload.params.verbose=-d
tools.stlink.upload.params.quiet=
tools.stlink.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"

View File

@ -1,12 +1,12 @@
/*
* aeroquad32 (STM32F103VET6, high density) linker script for
* STM32F4xx high density linker script for
* JTAG (bare metal, no bootloader) builds.
*/
MEMORY
{
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
}
/* GROUP(libcs3_stm32_high_density.a) */