Chat freely about anything...

User avatar
By noumes
#38354 Hey All,

Playing with programming the ESP8266 using the native SDK for the first time, and having trouble getting my application to execute
Code: Select allsystem_init_done_cb()


The source code is available here: https://github.com/NoumanSaleem/esp8266-hello-world

Here is the current output:

r...lœ˜rŸ.Œ#.ân€..à..Œ..‚ì.pŒ<Ž‚Ÿ.ìx.’ßǒÜäŒ.p...ònnä.Ä;ònĒÜä..Ž.bŽ#l`.$`.üpònàÃÜ...à‚ÇÀl.€..€..€.bÀ.nâãnÀϜŒŽÄ.Ž8..Œònnî.ÄÁŒŽ.l`.ü.Ü#‚nÀ..r....nrŽ’ß;.ÄÀ.?’Œ8r..pònàÃÜ...àrÇ.âœ....€..p..p’œ<.Äà...bÀÄ>~ònî.Äð..r...Ü#‚nÀ$ŽŒl`.ä¸`rn|’’nÀ..à‚ÇÃl`..¹~.ÄÀ...Ü#‚n€$.Œ..Œònnî.ÄÈl`..nnàƒÜ...àr‡.âÜ..ì.ž..p..p’Ü<.ÄÄìŽÄ.bÀľ~ònî.ÄÁŒ..l`..ž..nÜ.ÄØl`.ä8`rn|’’nÀ.Žàò‡.’`.ä8Ž’ß;.ÄÀ.?žl8r..don't use rtc mem data
r..¦µ½‘•Ò.šÑ…¡ŠÂÒ2•éš¢Ò"‰éªºÒ.ÅJj¤.‹‹.R-.¦HÈ.’.&KHR·ZºZX¶Z½Y²HC…scandone
no Your SSID found, reconnect after 1s
reconnect
f 0, scandone
no Your SSID found, reconnect after 1s
reconnect
f -180, scandone
no Your SSID found, reconnect after 1s
reconnect
f r0,


Which is missing the Initialized! from my initDone() method

Any guidance is greatly appreciated, thanks!
User avatar
By xtal
#38359 Looks like the serial monitor baud improper. try 9600 then 115200
Are you using ESPlorer ??? or other... for serial monitor????
Are you using ArduinoIDE or other ??? for the code loading ????
User avatar
By noumes
#38375 @ xtal, I am using CoolTerm for serial monitoring, compiling using the esp-open-sdk, and flashing using esptool.py

I am setting the buad to 115200, but please let me know if this is incorrect

Code: Select alluart_init(115200, 115200);
User avatar
By noumes
#38376 An interesting find...
When running the blinky example from Kolban's book on ESP8266, the app runs fine (light blinks); however, when I add uart_init() in user_init the light no longer blinks, and the serial output is the same as what I previously mentioned.


Code: Select all#include <osapi.h>
#include <os_type.h>
#include <gpio.h>
#include "driver/uart.h"

#define LED_GPIO 2

LOCAL uint8_t led_state=0;
LOCAL os_timer_t blink_timer;

LOCAL void ICACHE_FLASH_ATTR blink_cb(void *arg) {
  led_state = !led_state;
  GPIO_OUTPUT_SET(LED_GPIO, led_state);
}

void user_rf_pre_init(void) {
}

void user_init(void) {
  // THIS LINE. Works when disabled, light does not blink when uncommented.
  // uart_init(BIT_RATE_115200, BIT_RATE_115200);

  PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO4_U, FUNC_GPIO4);
  os_timer_disarm(&blink_timer);
  os_timer_setfn(&blink_timer, (os_timer_func_t *)blink_cb, (void *)0);
  os_timer_arm(&blink_timer, 1000, 1);
}


Any ideas?