개소리 왈왈/블로그2026. 2. 19. 10:07

슬슬 또 금액이 차올라서, 이 정도면 되었다 싶어 기부!

근데 내가 이거 리프레시 하면서 눌러 서버가 작동하는 비용을 고려하면

해피빈이 싼건가 고민이 되긴한다.

 

Posted by 구차니
프로그램 사용/gcc2026. 2. 18. 22:22

gcc 로 빌드하면 현재 빌드하는 시스템이 c가 아닌 cpp 라는걸 확인하기 위해(혹은 알려주기 위해)

__cplusplus 라는 선언을 -D__cplusplus 하듯 붙여주는 듯 한데

__cplusplus__가 아니라 왜 앞에만 언더바 두 개 일까.. -_-?

 

__STDC__
In normal operation, this macro expands to the constant 1, to signify that this compiler conforms to ISO Standard C. If GNU CPP is used with a compiler other than GCC, this is not necessarily true; however, the preprocessor always conforms to the standard unless the -traditional-cpp option is used.

This macro is not defined if the -traditional-cpp option is used.

On some hosts, the system compiler uses a different convention, where __STDC__ is normally 0, but is 1 if the user specifies strict conformance to the C Standard. CPP follows the host convention when processing system header files, but when processing user files __STDC__ is always 1. This has been reported to cause problems; for instance, some versions of Solaris provide X Windows headers that expect __STDC__ to be either undefined or 1. See Invocation.

__STDC_VERSION__
This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year and month of the Standard version. This signifies which version of the C Standard the compiler conforms to. Like __STDC__, this is not necessarily accurate for the entire implementation, unless GNU CPP is being used with GCC.

The value 199409L signifies the 1989 C standard as amended in 1994, which is the current default; the value 199901L signifies the 1999 revision of the C standard; the value 201112L signifies the 2011 revision of the C standard; the value 201710L signifies the 2017 revision of the C standard (which is otherwise identical to the 2011 version apart from correction of defects). The value 202311L is used for the -std=c23 and -std=gnu23 modes. An unspecified value larger than 202311L is used for the experimental -std=c2y and -std=gnu2y modes.

This macro is not defined if the -traditional-cpp option is used, nor when compiling C++ or Objective-C.

__STDC_HOSTED__
This macro is defined, with value 1, if the compiler’s target is a hosted environment. A hosted environment has the complete facilities of the standard C library available.

__cplusplus
This macro is defined when the C++ compiler is in use. You can use __cplusplus to test whether a header is compiled by a C compiler or a C++ compiler. This macro is similar to __STDC_VERSION__, in that it expands to a version number. Depending on the language standard selected, the value of the macro is 199711L for the 1998 C++ standard, 201103L for the 2011 C++ standard, 201402L for the 2014 C++ standard, 201703L for the 2017 C++ standard, 202002L for the 2020 C++ standard, 202302L for the 2023 C++ standard, or an unspecified value strictly larger than 202302L for the experimental languages enabled by -std=c++26 and -std=gnu++26.

__OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in use. You can use __OBJC__ to test whether a header is compiled by a C compiler or an Objective-C compiler.

__ASSEMBLER__
This macro is defined with value 1 when preprocessing assembly language.

[링크 : https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html]

 

 Version    __cplusplus
  4.8.3       201300L
  4.9.2       201300L
  5.1.0       201402L

[링크 : https://stackoverflow.com/questions/30995705/cplusplus-201402l-return-true-in-gcc-even-when-i-specified-std-c14[

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

gcc __attribute__((weak)) 테스트  (0) 2026.01.29
gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc tree vectorize  (0) 2023.01.26
gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
Posted by 구차니
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.02.12
  (0) 2026.01.15
짜증  (2) 2026.01.07
일이 끝나지 않아!  (0) 2025.12.18
외근, 피곤  (0) 2025.12.17
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 구차니