RTOS
RTOS를 탑재한 기기는 평균 약 0.8초가 걸리더라도 어떠한 상황에서도 1초 내에 끝내는 것을 보장한다. 이해의 편의를 위해 여기서는 초 단위를 예로 들었지만, RTOS는 대체로 수 밀리초(1000분의 1초), 심지어는 마이크로초(100만 분의 1초)단위로 컨트롤하기 위해 쓰인다. 시스템의 시간 관리 부분에 많은 비중을 투자하여, 응용 프로그램의 처리 요청을 정해진 시간 내에 끝마칠 수 있는 성능에 비중을 두고 있다. 선점형 멀티 태스킹을 지원하고 각 프로세스의 실행 순서를 정의하는데 많은 비중을 투자한다. 임베디드 시스템은 몇 달에서 길게는 몇 년간 재부팅 없이 실행되는 경우가 흔히 있다. 이 때문에 동적 메모리 할당을 최적화하여 메모리 단편화(memory fragmentation)를 허용하지 않는다. 즉, C에서의 malloc() 같은 함수를 거의 쓰지 않는다는 이야기다.
[나무위키 - 실시간 운영 체제]
A real-time operating system (RTOS) is an operating system (OS) for real-time applications that processes data and events that have critically defined time constraints. A RTOS is distinct from a time-sharing operating system, such as Unix, which manages the sharing of system resources with a scheduler, data buffers, or fixed task prioritization in a multitasking or multiprogramming environment. Processing time requirements need to be fully understood and bound rather than just kept as a minimum. All processing must occur within the defined constraints. Real-time operating systems are event-driven and preemptive, meaning the OS is capable of monitoring the relevant priority of competing tasks, and make changes to the task priority. Event-driven systems switch between tasks based on their priorities, while time-sharing systems switch the task based on clock interrupts.
[Real-time operating system - Wikipedia]
MDK-ARM
EWARM
IAR SYSTEMS : https://www.iar.com/kr/about/customers/ntt-docomo/
ARM KEIL : https://www2.keil.com/mdk5
DOS : DISK OPERATING SYSTEM
하드디스크를 실행
Single Task : main() - while(1)
Multi Task : while(1)문을 여러개 쓸 수 있게
네트워크
1. 처음 발생한 에러부터 잡아야 한다. warning은 무시하고.
2. &huart2에서 &huart3로 바꿔준다.
3. 다른 파일에 있는 변수를 사용하고 싶으면 extern UART_HandleTypeDef huart3;
4. UART_HandleTypeDef을 쓰기 위해서 #include "main.h"
5. &hi2c1를 해결하기 위해서 ioc에서 I2C1을 킨다.
6. IOC에서 I2C 설정을 위해 PB8, PB9를 I2C 설정으로 바꿔준다.
7. extern I2C_HandleTypeDef hi2c1;
Flash memory가 작을 때 optimization을 사용하나 충분할 때는 굳이 쓸 필요 없다.
BSP : BOARD SUPPORT PACKAGE
mentor graphics
GPL
DART
malloc -> heap
stack -> 지역변수, 전역변수
stack_size 변수 크기가 중요하다
세마포 유택스 시그나
메시지큐 : 문자열을 주고 받는 것
task 2개가 UART3를 공유해서 사용하려면 task 사이에 규칙을 정해줘야 한다.
'IT > 임베디드' 카테고리의 다른 글
2022년 8월 10일 수업 (0) | 2022.08.10 |
---|---|
RTOS (0) | 2022.08.08 |