'잡동사니'에 해당되는 글 14041건

  1. 2026.02.18 stm32f103c8t6 cpp std::cout 실패
  2. 2026.02.18 lvgl 속도 제한(?) 해제
  3. 2026.02.18 platform.io + vscode + esp32
  4. 2026.02.18 esp32 on arduino ide
  5. 2026.02.18 esp32 lvgl 관련 링크들
  6. 2026.02.17 대충 설 일정 끝
  7. 2026.02.16 내가 뒤쳐지는 건가..
  8. 2026.02.14 처갓댁 도착
  9. 2026.02.13 설 시작
  10. 2026.02.13 lvgl 기본 폰트 크기 바꾸기
embeded/Cortex-M3 STM2026. 2. 18. 22:14

아래코드까진 문제가 없는데

class my_class
{
public:
	int i_var;
	int f();
};

int my_class::f()
{
	return ++i_var;
}

int main(void)
{
	my_class *p_my_class = new my_class();
	p_my_class->f();
}

 

iostream을 추가해서 (아직 uart 출력을 연결하진 않고 빌드만 했지만)

std::cout을 통해 출력만 해보려고 했는데

#include <iostream>

class my_class
{
public:
	int i_var;
	int f();
};

int my_class::f()
{
	return ++i_var;
}

int main(void)
{
	my_class *p_my_class = new my_class();
	std::cout << p_my_class->f();
}

 

플래시 용량이 터져나가 버렸다.

cout을 쓰려면 최소 192KB 이상의 flash는 되어야 한다는건가?

22:05:02 **** Incremental Build of configuration Debug for project cpp_test ****
make -j4 all 
arm-none-eabi-g++ "../Core/Src/main.cpp" -mcpu=cortex-m3 -std=gnu++14 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-use-cxa-atexit -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/main.o"
arm-none-eabi-g++ -o "cpp_test.elf" @"objects.list"   -mcpu=cortex-m3 -T"/home/minimonk/STM32CubeIDE/workspace_1.19.0_cpp/cpp_test/STM32F103C8TX_FLASH.ld" --specs=nosys.specs -Wl,-Map="cpp_test.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
/home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-getentropyr.o): in function `_getentropy_r':
(.text._getentropy_r+0xe): warning: _getentropy is not implemented and will always fail
/home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-getentropyr.o): note: the message above does not take linker garbage collection into account
/home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: cpp_test.elf section `.text' will not fit in region `FLASH'
/home/minimonk/st/stm32cubeide_1.19.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.linux64_1.0.0.202410170706/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 109220 bytes
collect2: error: ld returned 1 exit status
make: *** [makefile:88: cpp_test.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

22:05:04 Build Failed. 4 errors, 1 warnings. (took 2s.252ms)

[링크 : https://igotit.tistory.com/entry/STM32CubeIDE-임베디드-코드에서-C-클래스-활용]

 


gpt 말로는 아래를 설정해주라는데, std::cout 하면 버퍼부터 하위시스템 다 끌려온다는거 치고는 너무 큰디..

데드 코드 삭제
-ffunction-sections
-fdata-sections

링커옵션
-Wl,--gc-sections


예외/RTTI 끄기
-fno-exceptions
-fno-rtti

newlib nano
--specs=nano.specs

 

그래서 설정을 보는데, 기본으로 부동소수점 출력/입력은 안하게 되어있고

 

g++ 쪽은 기본적으로 아래의 4개 플래그가 설정되어 있다.

-ffunctions-sections

-fdata-sections

-fno-exceptions

-fno-rtti

 

링커도 -Wl,--gc-sections 되어 있어서 더 옵션으로 먼가 줄일수 있는 상태는 아닌데..

[링크 : https://vuzwa.tistory.com/entry/STM32CubeIDE에서-개발환경-C-or-C로-전환하기]

 

그래서 std::cout 은 포기하고 printf나 쓰라고 하는건가?

그런데 rtti 까지 사용하지 않으면 cpp를 쓰는 이유가 머가 남지 -ㅁ-?

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32 rtc tamper  (0) 2026.01.29
stm32f103 rtc backup register  (0) 2026.01.29
stm32 hal rcc flag  (0) 2026.01.27
stm32 ivt  (0) 2026.01.27
bluepill stm32f103c8t6 USB CDC 리셋이후 안되는 문제  (0) 2026.01.27
Posted by 구차니
프로그램 사용/lvgl2026. 2. 18. 18:32

기본적으로 30fps 를 출력하는 것 같아서 속도를 더 올릴 수 없나 찾아보는중

 

sdkconfig
#
# HAL Settings
#
CONFIG_LV_DEF_REFR_PERIOD=33
CONFIG_LV_DPI_DEF=130
# end of HAL Settings

 

lv_conf_internal.h
/*====================
   HAL SETTINGS
 *====================*/

/** Default display refresh, input device read and animation step period. */
#ifndef LV_DEF_REFR_PERIOD
    #ifdef CONFIG_LV_DEF_REFR_PERIOD
        #define LV_DEF_REFR_PERIOD CONFIG_LV_DEF_REFR_PERIOD
    #else
        #define LV_DEF_REFR_PERIOD  33      /**< [ms] */
    #endif
#endif

 

lv_demo_benchmark.h
/**
 * Run all benchmark scenes.
 *
 * On the summary end screen the values shall be interpreted according to the following:
 * - CPU usage:
 *    - If `LV_SYSMON_GET_IDLE` is not modified it's measured based on the time spent in
 *      `lv_timer_handler`.
 *    - If an (RT)OS is used `LV_SYSMON_GET_IDLE` can be changed to a custom function
 *      which returns the idle percentage of idle task.
 *
 * - FPS: LVGL attempted to render this many times in a second. It's limited based on `LV_DEF_REFR_PERIOD`
 *
 * - Render time: LVGL spent this much time with rendering only. It's not aware of task yielding,
 *   but simply the time difference between the start and end of the rendering is measured
 *
 * - Flush time: It's the sum of
 *     - the time spent in the `flush_cb` and
 *     - the time spent with waiting for flush ready.
 */
void lv_demo_benchmark(void);
lv_display.c
lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
{
    /*Create a refresh timer*/
    disp->refr_timer = lv_timer_create(lv_display_refr_timer, LV_DEF_REFR_PERIOD, disp);
    LV_ASSERT_MALLOC(disp->refr_timer);
    if(disp->refr_timer == NULL) {
        lv_free(disp);
        return NULL;
    }
}

 

다만 perf test 쪽 헤더를 쓰게 되면 16msec로 60fps로 상향되는 듯.

lv_test_perf_conf.h

/**
 * @file lv_conf.h
 * Configuration file for v9.3.0-dev
 */

/*
 * Copy this file as `lv_conf.h`
 * 1. simply next to `lvgl` folder
 * 2. or to any other place and
 *    - define `LV_CONF_INCLUDE_SIMPLE`;
 *    - add the path as an include path.
 */

/* clang-format off */
#if 1 /* Set this to "1" to enable content */

    #ifndef LV_CONF_H
        #define LV_CONF_H

        #define LV_BUILD_TEST_PERF 1
        #define LV_USE_TEST 1
        /* If you need to include anything here, do it inside the `__ASSEMBLY__` guard */
        #if  0 && defined(__ASSEMBLY__)
            #include "my_include.h"
        #endif

        /*====================
        HAL SETTINGS
        *====================*/

        /** Default display refresh, input device read and animation step period. */
        #define LV_DEF_REFR_PERIOD  16      /**< [ms] */

        /** Default Dots Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
        * (Not so important, you can adjust it to modify default sizes and spaces.) */
        #define LV_DPI_DEF 130              /**< [px/inch] */

'프로그램 사용 > lvgl' 카테고리의 다른 글

esp32 lvgl 관련 링크들  (0) 2026.02.18
lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니
embeded/esp322026. 2. 18. 18:08

platform.io ide

2026.02.18 기준 6.4M 오호..

 

다운로드 눌러서 가보면 ㅋㅋㅋㅋ

vscode 받고 플러그인 받아서 하란다 ㅋㅋㅋㅋ

아니 먼가 독립 ide인척 하더니 이게 머야 ㅋㅋㅋㅋ

[링크 : https://platformio.org/install/ide?install=vscode]

[링크 : https://platformio.org/platformio-ide]

 

[링크 : https://oesnuj.tistory.com/entry/VS-Code에서-아두이노-개발-PlatformIO로-쉽게-시작하는-방법]

[링크 : https://epictrave.tistory.com/13]

[링크 : https://wikidocs.net/252665]

'embeded > esp32' 카테고리의 다른 글

esp32 on arduino ide  (0) 2026.02.18
esp component 와 idf.py create-project-from-example  (0) 2026.02.10
idf.py help  (0) 2026.02.10
idf 프로젝트 생성하기  (0) 2026.02.08
esp-idf on windows  (0) 2026.02.05
Posted by 구차니
embeded/esp322026. 2. 18. 18:02

오랫만에 설치하려니 헷갈리고 이상하네

일단은 먼가 다운로드 관련 timeout 문제가 있어서 손을 봐야하고

조금 고민하면 당연한거긴 한데.. esp32를 사용하는 아두이노 보드를 손보려는게 아니니

espressif system에서 제공한 보드 매니저를 쓰는게 맞긴하..겠지?

 

아두이노 설치는 스킵

tools - board - boards manager

 

esp32 검색

 

"esp32 by espressif systems" 를 설치(2026.02.18 기준 3.3.7 버전)

 

에러가 발생하면

 

아래 파일을 열어서 아래 내용을 추가. 300초 이상은 접속을 못하게 해놔서 용량 큰 걸 받을수가 없는 듯?

C:\Users\<username>\.arduinoIDE\arduino-cli.yaml 

[링크 : https://github.com/espressif/arduino-esp32/issues/12161#issuecomment-3680101494]

[링크 : https://github.com/espressif/arduino-esp32/issues/12354]

 

 

[링크 : https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html]

[링크 : https://www.bneware.com/blogPost/esp32_arduino_ide]

[링크 : https://fishpoint.tistory.com/9967]

[링크 : https://m.blog.naver.com/mapes_khkim/222901956974]

'embeded > esp32' 카테고리의 다른 글

platform.io + vscode + esp32  (0) 2026.02.18
esp component 와 idf.py create-project-from-example  (0) 2026.02.10
idf.py help  (0) 2026.02.10
idf 프로젝트 생성하기  (0) 2026.02.08
esp-idf on windows  (0) 2026.02.05
Posted by 구차니
프로그램 사용/lvgl2026. 2. 18. 10:59

idf를 통해서 처음부터 올리고 싶은데 잘 안보이네..

 

[링크 : https://blog.naver.com/alfee0/223742807419] 알피공

[링크 : https://fishpoint.tistory.com/12311] 캐어랩

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl 속도 제한(?) 해제  (0) 2026.02.18
lvgl 기본 폰트 크기 바꾸기  (0) 2026.02.13
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니

어우 피곤하다

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

처갓댁 도착  (0) 2026.02.14
설 시작  (0) 2026.02.13
눈썰매장 - 양주눈꽃축제  (0) 2026.02.01
1월의 마지막 날  (0) 2026.01.31
개털 밈  (0) 2026.01.18
Posted by 구차니

OpenClaw 창시자, "나는 내가 읽지 않은 코드를 배포합니다."

[링크 : https://yozm.wishket.com/magazine/detail/3609/]

 

"I ship code I don't read."

솔찍히 OpenClaw를 써보지도 않았고 이 사람이 머하는 사람인지도 모르겠지만

개발자라고 한다면 새로운 패러다임이라고 봐야하나 고민이 되고

개발자가 아닌 사장이나 디렉터라고 한다면 이해는 되긴한데..

 

물론 사람도 팀이 커지면 최상위 관리자가 코드 리뷰 직접 하면서 일하진 않으니까

단지 개발자 일정 닥달하고 품질 이라는 과정을 거쳐서

원하는 결과가 나오는지 성능 지표와 함께 영업을 하던가 하면 되니까 딱히 틀린말은 아닌데..

 

아무튼 이제 개발자가 당연히(?) 기획으로 올라가서

개발지식으로 개발팀을 꾸려나간다고 봐야하려나.. 단지 사람이 아닌 ai를 다룰뿐?

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

와 지하철 왜 이따구야?!?  (0) 2026.03.03
피곤  (0) 2026.02.12
  (0) 2026.01.15
짜증  (2) 2026.01.07
일이 끝나지 않아!  (0) 2025.12.18
Posted by 구차니

어우 3시간 넘개 걸렸내

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

대충 설 일정 끝  (0) 2026.02.17
설 시작  (0) 2026.02.13
눈썰매장 - 양주눈꽃축제  (0) 2026.02.01
1월의 마지막 날  (0) 2026.01.31
개털 밈  (0) 2026.01.18
Posted by 구차니

2시간 정도 걸리던 거리가 1시간 더 추가되어 겨우 도착했다.

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

대충 설 일정 끝  (0) 2026.02.17
처갓댁 도착  (0) 2026.02.14
눈썰매장 - 양주눈꽃축제  (0) 2026.02.01
1월의 마지막 날  (0) 2026.01.31
개털 밈  (0) 2026.01.18
Posted by 구차니
프로그램 사용/lvgl2026. 2. 13. 11:16

lv_conf.h 에서 아래를 14 에서 28로 바꾸고 빌드하니 잘된다.

/*Always set a default font*/
//#define LV_FONT_DEFAULT &lv_font_montserrat_14
#define LV_FONT_DEFAULT &lv_font_montserrat_28

 

lv_font.h 에서 아래처럼 되어있는데 


/**
 * Just a wrapper around LV_FONT_DEFAULT because it might be more convenient to use a function in some cases
 * @return  pointer to LV_FONT_DEFAULT
 */
static inline const lv_font_t * lv_font_default(void)
{
    return LV_FONT_DEFAULT;
}

 

lv_style.c 에서도 결국에는 LV_FONT_DEFAULT 에서 정의된걸 끌어가는것 같은데.. 잘 모르겠네

lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)
{
    lv_style_value_t value;
    switch(prop) {
        case LV_STYLE_TRANSFORM_ZOOM:
            value.num = LV_IMG_ZOOM_NONE;
            break;
        case LV_STYLE_BG_COLOR:
            value.color = lv_color_white();
            break;
        case LV_STYLE_BG_GRAD_COLOR:
        case LV_STYLE_BORDER_COLOR:
        case LV_STYLE_SHADOW_COLOR:
        case LV_STYLE_OUTLINE_COLOR:
        case LV_STYLE_ARC_COLOR:
        case LV_STYLE_LINE_COLOR:
        case LV_STYLE_TEXT_COLOR:
        case LV_STYLE_IMG_RECOLOR:
            value.color = lv_color_black();
            break;
        case LV_STYLE_OPA:
        case LV_STYLE_BORDER_OPA:
        case LV_STYLE_TEXT_OPA:
        case LV_STYLE_IMG_OPA:
        case LV_STYLE_BG_IMG_OPA:
        case LV_STYLE_OUTLINE_OPA:
        case LV_STYLE_SHADOW_OPA:
        case LV_STYLE_LINE_OPA:
        case LV_STYLE_ARC_OPA:
            value.num = LV_OPA_COVER;
            break;
        case LV_STYLE_BG_GRAD_STOP:
            value.num = 255;
            break;
        case LV_STYLE_BORDER_SIDE:
            value.num = LV_BORDER_SIDE_FULL;
            break;
        case LV_STYLE_TEXT_FONT:
            value.ptr = LV_FONT_DEFAULT;
            break;
        case LV_STYLE_MAX_WIDTH:
        case LV_STYLE_MAX_HEIGHT:
            value.num = LV_COORD_MAX;
            break;
        default:
            value.ptr = NULL;
            value.num = 0;
            break;
    }

    return value;
}

 

아무튼 콤보박스에서 터치해서 목록을 띄우면 14로 뜨는데 이렇게 기본을 키우니 오히려 속 편하기도 하다.

그런데 코드보다보니

lv_theme.c 에서 아래처럼 폰트 패밀리를 small normal large로 쓸수 있을것 같은데 찾아봐야겠다.

const lv_font_t * lv_theme_get_font_small(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_small : LV_FONT_DEFAULT;
}

const lv_font_t * lv_theme_get_font_normal(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_normal : LV_FONT_DEFAULT;
}

const lv_font_t * lv_theme_get_font_large(lv_obj_t * obj)
{
    lv_theme_t * th = lv_theme_get_from_obj(obj);
    return th ? th->font_large : LV_FONT_DEFAULT;
}

 

[링크 : https://docs.lvgl.io/9.2/overview/font.html]

[링크 : https://forum.lvgl.io/t/how-to-change-font-size/20531]

'프로그램 사용 > lvgl' 카테고리의 다른 글

lvgl 속도 제한(?) 해제  (0) 2026.02.18
esp32 lvgl 관련 링크들  (0) 2026.02.18
lvgl textarea  (0) 2026.02.11
squareline studio export  (0) 2026.02.10
squareline studio 보드설정  (0) 2026.02.10
Posted by 구차니