[solved] blinky compiles, flashes and then silence
Posted: Tue Jun 27, 2017 5:03 pm
hey everyone,
after three days of google fu, cursing the gods and way too much smoking I got to the end of my wisdom.
I set up the esp-open-sdk (https://github.com/pfalcon/esp-open-sdk) on an ubuntu OS, wired everything together on a breadboard (esp-100 an esp-07 without chip-antenna, ft232 breakout, powersupply).
It compiles without errors, flashes with verify but after resetting the ESP nothing happens. I can still read flash_id or chip_id with esptool but that is about it.
Makefile:
blinky.c:
The chain of commands is "make clean" -> "make" -> "make-flash"
I found an already compiled version of blinky (http://noosrequired.com/Javier_varez/te ... ree/master) and testet flashing to make sure there wasn't any hardware issue. And there wasn't.
The above code comes from Javier varez and the makefile is from the open-sdk Blinky example. Different Baudrates have also been tried.
This is the point I have to give up trying it on my own furthermore an am asking for help on this.
Greetings,
knoterich
after three days of google fu, cursing the gods and way too much smoking I got to the end of my wisdom.
I set up the esp-open-sdk (https://github.com/pfalcon/esp-open-sdk) on an ubuntu OS, wired everything together on a breadboard (esp-100 an esp-07 without chip-antenna, ft232 breakout, powersupply).
It compiles without errors, flashes with verify but after resetting the ESP nothing happens. I can still read flash_id or chip_id with esptool but that is about it.
Makefile:
Code: Select all
CC = xtensa-lx106-elf-gcc
CFLAGS = -I. -mlongcalls
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc
LDFLAGS = -Teagle.app.v6.ld
blinky-0x00000.bin: blinky
esptool.py elf2image $^
blinky: blinky.o
blinky.o: blinky.c
flash: blinky-0x00000.bin
esptool.py --baud 19200 write_flash 0 blinky-0x00000.bin 0x10000 blinky-0x10000.bin
clean:
rm -f blinky blinky.o blinky-0x00000.bin blinky-0x10000.bin
blinky.c:
Code: Select all
/*
* main.c
*
* Created on: 28/1/2016
* Author: usuario
*/
#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#define user_procTaskPrio 0
#define user_procTaskQueueLen 1
os_event_t user_procTaskQueue[user_procTaskQueueLen];
static void user_procTask(os_event_t *events);
static volatile os_timer_t some_timer;
void some_timerfunc(void *arg)
{
//Do blinky stuff
if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & BIT2)
{
//Set GPIO2 to LOW
gpio_output_set(0, BIT2, BIT2, 0);
}
else
{
//Set GPIO2 to HIGH
gpio_output_set(BIT2, 0, BIT2, 0);
}
}
//Do nothing function
static void ICACHE_FLASH_ATTR
user_procTask(os_event_t *events)
{
os_delay_us(10);
}
//Init function
void ICACHE_FLASH_ATTR
user_init()
{
// Initialize the GPIO subsystem.
gpio_init();
//Set GPIO2 to output mode
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2);
//Set GPIO2 low
gpio_output_set(0, BIT2, BIT2, 0);
//Disarm timer
os_timer_disarm(&some_timer);
//Setup timer
os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
//Arm the timer
//&some_timer is the pointer
//1000 is the fire time in ms
//0 for once and 1 for repeating
os_timer_arm(&some_timer, 1000, 1);
//Start os task
system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
}
The chain of commands is "make clean" -> "make" -> "make-flash"
I found an already compiled version of blinky (http://noosrequired.com/Javier_varez/te ... ree/master) and testet flashing to make sure there wasn't any hardware issue. And there wasn't.
The above code comes from Javier varez and the makefile is from the open-sdk Blinky example. Different Baudrates have also been tried.
This is the point I have to give up trying it on my own furthermore an am asking for help on this.
Greetings,
knoterich