chucky2
@chucky24740
Reviews Written
1
Average Rating
5.0
Posts
Q&A
[์ง๋ฌธ/ํด๊ฒฐ์๋ฃ] deferred interrupt ์ฒ๋ฆฌ์์ portYIELD_FROM_ISR api์ ์ฉ๋
๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค. ํ์ธ์ฐจ์์์ ์ฌ ๋ฌธ์ ๋๋ฆฝ๋๋ค.case1: call back์์ portYIELD_FROM_ISR ํธ์ถ์isr ์ง์ isr ๋ด๋ถ์์ call back ํจ์ ํธ์ถcall back ํจ์์์ portYIELD_FROM_ISR ํธ์ถ (์ต์ข portYIELD ํธ์ถ๋์ด portNVIC_INT_CTRL_REG register์ PendSV bit set)isr ์ค call back ์ดํ ๋ถ๋ถ ์ํisr ์๋ฃxPortPendSVHandler์ ์ํด context switching ๋ฐ์case2: call back์์ portYIELD_FROM_ISR ๋ฏธํธ์ถ์isr ์ง์ isr ๋ด๋ถ์์ call back ํจ์ ํธ์ถcall back ํจ์ ์ํisr ์ค call back ์ดํ ๋ถ๋ถ ์ํisr ์๋ฃ์ ์ ๋นํ๋ task๋ก ๋ณต๊ทxPortSysTickHandler์ ์ํด context switching ๋ฐ์ ๊ฒฐ๊ตญ,Case1์ Case2์์ ๋ฐ์ํ๋ ์ง์ฐ ์๊ฐ (task๋ก ์ฌ ๋ณต๊ท ํ, ๋ค์ tick interrupt๊ฐ ๋ฐ์ํ๊ธฐ ๊น์ง ์๊ฐ) ์ด ๋ฐ์ํ์ง ์๋ ๊ฒ์ผ๋ก ์ดํดํ์ต๋๋ค. ์ ๋ชป ์๊ฐํ๊ณ ์๋ ๋ถ๋ถ์ด ์์ผ๋ฉด ์ ์ ํด์ฃผ์ธ์.
- 1
- 2
- 1.2K
Q&A
[์ง๋ฌธ/ํด๊ฒฐ์๋ฃ] configUSE_IDLE_HOOK ๋ฅผ 1๋ก ์ค์ ํ๊ณ ๋์ ์ BusFault exception ๋ฐ์
๋ฌธ์ ์ ์์ธ์ idle task์ stack overflow๋ก ์ถ์ ๋ฉ๋๋ค.ํน์ exception ์ํฉ์์ stack ๋ถ์ํ๋ ๋ฐฉ๋ฒ์ด ์ ๋ฆฌ๋ ๋ด์ฉ์ด ์์ผ๋ฉด ๊ณต์ ๋ถํ ๋๋ฆฝ๋๋ค.๋ด๊ณต์ด ๋ถ์กฑํ์ฌ....: stack size ์กฐ์ ์ idle task์ stack ๋ง์ง๋ง ์์น๋ 0x200000e4. ์ ์๋์ ์์๋ stack์ ๋ฌธ์ ์์(์ฌ์ง)๋ฌธ์ ๋ฐ์ ์, idle task์ stack์ด ๋ณ์ ์์ญ์ ์นจ๋ฒํ์ฌ exception์ด ๋ฐ์ํ๋ ๊ฒ์ผ๋ก ๋ณด์(์ฌ์ง)stack ์กฐ์ freertosconfig_base.h์์ idle stack size๋ฅผ ๋๋ ค์ test ํด๋ณธ ๊ฒฐ๊ณผ ์ ์ ๋์ ํ์ธํ์์ต๋๋ค.#define configUSE_TICK_HOOK 0 #define configCPU_CLOCK_HZ ( SystemCoreClock ) #define configTICK_RATE_HZ ((TickType_t)1000) #define configMAX_PRIORITIES ( 20 ) //#define configMINIMAL_STACK_SIZE ((uint16_t)128) //cms: org stack sz #define configMINIMAL_STACK_SIZE ((uint16_t)256) //cms: test #define configTOTAL_HEAP_SIZE ((size_t)15360) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_16_BIT_TICKS 0 #define configUSE_MUTEXES 1 #define configQUEUE_REGISTRY_SIZE 8uart ์ถ๋ ฅ ์ํฉ(์ฌ์ง)๊ฐ์ฌํฉ๋๋ค.
- 1
- 2
- 449
Q&A
[์ง๋ฌธ/ํด๊ฒฐ์๋ฃ] configUSE_IDLE_HOOK๋ฅผ 1๋ก ์ค์ ์ ๊ธฐ์กด task printf ๋ฌธ ๋์ ๋ถ๊ฐ๋ฅ
idle hook ํจ์์์ ์ถ๋ ฅ๋์ ์ค์ฌ์ฃผ์๋๋ ์๋์ ๊ฐ์ด ์ ์ ๋์ํฉ๋๋ค.(์ฌ์ง)๋ฐ์ํ source:void vApplicationIdleHook (void) { #if (defined (cms_enable_print_at_idel_hook) && ( cms_enable_print_at_idel_hook == 1)) printf("T1 %d, T2 %d, T3 %d, Idle %d\n", task1timer, task2timer, task3timer, idletimer); #else if(idletimer % 100000 == 0) { printf("."); fflush(stdout); } idletimer++; #endif }
- 1
- 2
- 447
Q&A
[์ง๋ฌธ/ํด๊ฒฐ์๋ฃ] Idle Task hooking ํจ์ (vApplicationIdleHook ) ์ํ๋์ง ์์
freertosconfig.h์์ hooking ํจ์ enableํ๋ ๋ถ๋ถ ์ฐพ์์ ์ํ๊ฒฐ๊ณผ, vApplicationIdleHook() ์ ์์ ์ผ๋ก ํธ์ถ๋จ์ ํ์ธํ์ต๋๋ค.(์ฌ์ง)
- 0
- 1
- 395




