Merge pull request #154 from martinayotte/master
Fix issues with arduino_uip library and other minor changes on STM32F4
This commit is contained in:
commit
bfd9e4e591
|
@ -30,13 +30,13 @@ void setup() {
|
||||||
Ethernet.begin(mac);
|
Ethernet.begin(mac);
|
||||||
|
|
||||||
Serial.print("localIP: ");
|
Serial.print("localIP: ");
|
||||||
Serial.println(Ethernet.localIP());
|
Serial.println(Ethernet.localIP().toString());
|
||||||
Serial.print("subnetMask: ");
|
Serial.print("subnetMask: ");
|
||||||
Serial.println(Ethernet.subnetMask());
|
Serial.println(Ethernet.subnetMask().toString());
|
||||||
Serial.print("gatewayIP: ");
|
Serial.print("gatewayIP: ");
|
||||||
Serial.println(Ethernet.gatewayIP());
|
Serial.println(Ethernet.gatewayIP().toString());
|
||||||
Serial.print("dnsServerIP: ");
|
Serial.print("dnsServerIP: ");
|
||||||
Serial.println(Ethernet.dnsServerIP());
|
Serial.println(Ethernet.dnsServerIP().toString());
|
||||||
|
|
||||||
next = 0;
|
next = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ email=Norbert Truchsess <norbert.truchsess@t-online.de>
|
||||||
sentence=Ethernet library for ENC28J60
|
sentence=Ethernet library for ENC28J60
|
||||||
paragraph=implements the same API as stock Ethernet-lib. Just replace the include of Ethernet.h with UIPEthernet.h
|
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
|
url=https://github.com/ntruchsess/arduino_uip
|
||||||
architectures=STM32F1
|
architectures=STM32F4
|
||||||
version=1.04
|
version=1.04
|
||||||
dependencies=
|
dependencies=
|
||||||
core-dependencies=arduino (>=1.5.0)
|
core-dependencies=arduino (>=1.5.0)
|
||||||
|
|
|
@ -57,6 +57,7 @@ static byte selectPin;
|
||||||
|
|
||||||
void Enc28J60Network::init(uint8_t* macaddr)
|
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
|
MemoryPool::init(); // 1 byte in between RX_STOP_INIT and pool to allow prepending of controlbyte
|
||||||
// initialize I/O
|
// initialize I/O
|
||||||
// ss as output:
|
// ss as output:
|
||||||
|
@ -100,8 +101,12 @@ void Enc28J60Network::init(uint8_t* macaddr)
|
||||||
#ifdef ENC28J60DEBUG
|
#ifdef ENC28J60DEBUG
|
||||||
Serial.println("ENC28J60::initialize / before readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
|
Serial.println("ENC28J60::initialize / before readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
|
||||||
#endif
|
#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
|
#ifdef ENC28J60DEBUG
|
||||||
Serial.println("ENC28J60::initialize / after readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
|
Serial.println("ENC28J60::initialize / after readOp(ENC28J60_READ_CTRL_REG, ESTAT)");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,17 +28,12 @@
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include "mempool.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 ENC28J60_CONTROL_CS PC8
|
||||||
//#define SPI_MOSI PA7
|
#else
|
||||||
//#define SPI_MISO PA6
|
#define ENC28J60_CONTROL_CS SPI.nssPin()
|
||||||
//#define SPI_SCK PA5
|
#endif
|
||||||
//#define SPI_SS PA8
|
|
||||||
|
|
||||||
#define UIP_RECEIVEBUFFERHANDLE 0xff
|
#define UIP_RECEIVEBUFFERHANDLE 0xff
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ compiler.define=-DARDUINO=
|
||||||
# this can be overriden in boards.txt
|
# this can be overriden in boards.txt
|
||||||
build.cpu_flags=
|
build.cpu_flags=
|
||||||
build.hs_flag=
|
build.hs_flag=
|
||||||
build.common_flags=
|
build.common_flags=-mthumb -D__STM32F4__
|
||||||
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}
|
build.extra_flags= {build.cpu_flags} {build.hs_flag} {build.common_flags}
|
||||||
|
|
||||||
# These can be overridden in platform.local.txt
|
# 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
|
# STLINK/V2
|
||||||
|
|
||||||
tools.stlink.cmd=stlink
|
tools.stlink.cmd=stlink_upload
|
||||||
tools.stlink.cmd.windows=stlink_upload.bat
|
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={runtime.hardware.path}/tools/win
|
||||||
|
tools.stlink.path.linux={runtime.hardware.path}/tools/linux/
|
||||||
tools.stlink.upload.params.verbose=-d
|
tools.stlink.upload.params.verbose=-d
|
||||||
tools.stlink.upload.params.quiet=
|
tools.stlink.upload.params.quiet=
|
||||||
tools.stlink.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
|
tools.stlink.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* aeroquad32 (STM32F103VET6, high density) linker script for
|
* STM32F4xx high density linker script for
|
||||||
* JTAG (bare metal, no bootloader) builds.
|
* JTAG (bare metal, no bootloader) builds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
|
||||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
rom (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GROUP(libcs3_stm32_high_density.a) */
|
/* GROUP(libcs3_stm32_high_density.a) */
|
||||||
|
|
Loading…
Reference in New Issue