Monday, February 5, 2024

xdebug 무조건 트레이스 시작시키기(xDebug, stop break point always setup)

php.ini 에 xdebug 설정을 넣을때 아래와 같이 설정하면 된다.

dll 파일의 이름은 각자 자기 상황에 맞게 수정하시라.


this setup will stopped always on break point. 

DLL filename depends on your system.



[xdebug]

zend_extension="php_xdebug-3.3.0-8.1-vs16-nts-x86_64.dll"

xdebug.mode=debug

xdebug.default_enable = 1

xdebug.remote_enable = 1

xdebug.remote_autostart = 1

xdebug.idekey="PHPSTORM"

xdebug.client_host=127.0.0.1

xdebug.client_port=9000

xdebug.start_with_request=yes

Sunday, January 28, 2024

NanoCAD is Free CAD program like AutoCAD

NanoCAD is free for personal cad program. Usage is same as AutoCAD.

go to nanocad.com, download personal version. 

https://nanocad.com/personal/






Saturday, January 27, 2024

HardFault (error ) on STM32 USB Host + FreeRTOS

I have Hard fault when USB device Attached to my STM32F407.


STM32CubeMX makes rtos STACK SIZE default to 128 bytes.

It is too small.


You can increase stack size.


Filename : USB_HOST/Target/usbh_config.h


Original (ERROR case)


#if (USBH_USE_OS == 1)

#include "cmsis_os.h"

#define USBH_PROCESS_PRIO osPriorityNormal

#define USBH_PROCESS_STACK_SIZE ((uint16_t)128)

#endif /* (USBH_USE_OS == 1) */



Fix (ERROR case)


#if (USBH_USE_OS == 1)

#include "cmsis_os.h"

#define USBH_PROCESS_PRIO osPriorityNormal

#define USBH_PROCESS_STACK_SIZE ((uint16_t)2048)

#endif /* (USBH_USE_OS == 1) */

 





Sunday, October 29, 2023

Wednesday, October 25, 2023

Monday, August 28, 2023

Wednesday, June 14, 2023

ESP32 Clear(disable) esp_deep_sleep_enable_gpio_wakeup

in ESP32 C3

esp32 c3 have no disable gpio wakeup function. so, gpio wakeup masks adds only. 

PROBLEM:

step 1: 
    esp_deep_sleep_enable_gpio_wakeup( 1<<GPIO_NUM_2 , 0 );
    esp_deep_sleep_enable_gpio_wakeup( 1<<GPIO_NUM_5 , 0 );
    esp_deep_sleep_start();
step 2: 
    wakeup 
step 3:
    esp_deep_sleep_enable_gpio_wakeup( 1<<GPIO_NUM_5 , 0 );
    esp_deep_sleep_start();
step 4 (problem):
    ESP32 can wakeup by GPIO_NUM_2 !!!!
    

Reason: ESP32 SDK 

esp_deep_sleep_enable_gpio_wakeup does not clear for other pins.

You can modify SDK source code.

sleep_modes.c   esp_deep_sleep_enable_gpio_wakeup function


esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepsleep_gpio_wake_up_mode_t mode)
{
    if (mode > ESP_GPIO_WAKEUP_GPIO_HIGH) {
        ESP_LOGE(TAG, "invalid mode");
        return ESP_ERR_INVALID_ARG;
    }
    gpio_int_type_t intr_type = ((mode == ESP_GPIO_WAKEUP_GPIO_LOW) ? GPIO_INTR_LOW_LEVEL : GPIO_INTR_HIGH_LEVEL);
    esp_err_t err = ESP_OK;
   
    /*s_config.gpio_wakeup_mask = 0;
    for (gpio_num_t gpio_idx = GPIO_NUM_0; gpio_idx < GPIO_NUM_MAX; gpio_idx++, gpio_pin_mask >>= 1)
    {
       gpio_deep_sleep_wakeup_disable(gpio_idx);
   }*/
   
   
    for (gpio_num_t gpio_idx = GPIO_NUM_0; gpio_idx < 6; gpio_idx++, gpio_pin_mask >>= 1) {
        if ((gpio_pin_mask & 1) == 0) {
           s_config.gpio_wakeup_mask &= ~BIT(gpio_idx);
           gpio_deep_sleep_wakeup_disable(gpio_idx);
           
            continue;
        }
        if (!esp_sleep_is_valid_wakeup_gpio(gpio_idx)) {
            ESP_LOGE(TAG, "invalid mask, please ensure gpio number is no more than 5");
            return ESP_ERR_INVALID_ARG;
        }
        err = gpio_deep_sleep_wakeup_enable(gpio_idx, intr_type);

        s_config.gpio_wakeup_mask |= BIT(gpio_idx);
        if (mode == ESP_GPIO_WAKEUP_GPIO_HIGH) {
            s_config.gpio_trigger_mode |= (mode << gpio_idx);
        } else {
            s_config.gpio_trigger_mode &= ~(mode << gpio_idx);
        }
    }
    s_config.wakeup_triggers |= RTC_GPIO_TRIG_EN;
   
    rtc_hal_gpio_clear_wakeup_status();
    return err;
}


after modify , If you want use multiple pins for wakeup source, 
call esp_deep_sleep_enable_gpio_wakeup with pin bitmask. 
example: esp_deep_sleep_enable_gpio_wakeup(  1<<GPIO_NUM_2 |  1<<GPIO_NUM_5 );



In my case , sleep_modes.c located on C:\Espressif\frameworks\esp-idf-5.0\components\esp_hw_support