Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

PWM Problem

edited July 29 in Mongoose OS

I have following code, but no PWM output on Pin 4

#include "mgos.h"
#include "mgos_pwm.h"
enum mgos_app_init_result mgos_app_init(void) {
  LOG(LL_INFO, ("Hi there"));
  mgos_gpio_set_mode(4, MGOS_GPIO_MODE_OUTPUT);
  bool val = mgos_pwm_set(4, 400, 1);
  if(val) {
    LOG(LL_INFO, ("Success"));
  } else {
    LOG(LL_INFO, ("Fail"));
  }
  return MGOS_APP_INIT_SUCCESS;
}

Log

[Jul 19 13:51:31.494] rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[Jul 19 13:51:31.494] configsip: 0, SPIWP:0xee
[Jul 19 13:51:31.494] clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[Jul 19 13:51:31.494] mode:DIO, clock div:2
[Jul 19 13:51:31.494] load:0x3fff0018,len:4
[Jul 19 13:51:31.494] load:0x3fff001c,len:5576
[Jul 19 13:51:31.494] load:0x40078000,len:0
[Jul 19 13:51:31.494] ho 12 tail 0 room 4
[Jul 19 13:51:31.494] [0;32mI (113) boot: OTA data 0: seq 0x00000001, st 0x10, CRC 0x157a2b85, valid? 1[0m
[Jul 19 13:51:31.564] [0;32mI (169) esp_image: segment 1: paddr=0x00026120 vaddr=0x3ffb0000 size=0x01908 (  6408) load[0m
[Jul 19 13:51:31.564] [0;32mI (171) esp_image: segment 2: paddr=0x00027a30 vaddr=0x3ffb1908 size=0x00000 (     0) load[0m
[Jul 19 13:51:31.564] [0;32mI (175) esp_image: segment 3: paddr=0x00027a38 vaddr=0x40080000 size=0x00400 (  1024) load[0m
[Jul 19 13:51:31.564] [0;32mI (185) esp_image: segment 4: paddr=0x00027e40 vaddr=0x40080400 size=0x081d0 ( 33232) load[0m
[Jul 19 13:51:31.565] [0;32mI (207) esp_image: segment 5: paddr=0x00030018 vaddr=0x400d0018 size=0x5783c (358460) map[0m
[Jul 19 13:51:31.841] [0;32mI (332) esp_image: segment 6: paddr=0x0008785c vaddr=0x400885d0 size=0x00a80 (  2688) load[0m
[Jul 19 13:51:31.841] [0;32mI (334) esp_image: segment 7: paddr=0x000882e4 vaddr=0x400c0000 size=0x00000 (     0) load[0m
[Jul 19 13:51:31.843] [0;32mI (339) esp_image: segment 8: paddr=0x000882ec vaddr=0x50000000 size=0x00000 (     0) load[0m
[Jul 19 13:51:31.843] [0;32mI (353) boot: Loaded app from partition at offset 0x10000[0m
[Jul 19 13:51:31.844] [0;32mI (354) boot: Disabling RNG early entropy source...[0m
[Jul 19 13:51:31.844] [0;32mI (360) cpu_start: Pro cpu up.[0m
[Jul 19 13:51:31.844] [0;32mI (363) cpu_start: Single core mode[0m
[Jul 19 13:51:31.844] [0;32mI (368) heap_init: Initializing. RAM available for dynamic allocation:[0m
[Jul 19 13:51:31.844] [0;32mI (375) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
[Jul 19 13:51:31.844] [0;32mI (381) heap_init: At 3FFB36C0 len 0002C940 (178 KiB): DRAM[0m
[Jul 19 13:51:31.844] mg_ssl_if_init       mbed TLS 2.8.0
[Jul 19 13:51:31.921] mgos_vfs_print_fs_in /: size 233681, used: 21335, free: 212346
[Jul 19 13:51:31.985] mgos_sys_config_init MAC: 240AC4042AE4
[Jul 19 13:51:32.027] mgos_sys_config_init WDT: 30 seconds
[Jul 19 13:51:32.027] mg_rpc_channel_uart  0x3ffbc7d4 UART0
[Jul 19 13:51:32.027] mgos_app_init        Hi there
[Jul 19 13:51:32.027] [0;31mE (557) ledc: ledc_set_duty_with_hpoint(383): hpoint argument is invalid[0m
[Jul 19 13:51:32.027] mgos_app_init        Success
[Jul 19 13:51:32.027] mgos_init            Init done, RAM: 317380 total, 274292 free, 274216 min free

Comments

Sign In or Register to comment.