초보의 아웅다웅 설계하기 336

다중 이동식 저장장치

사용 MCU : STM32F103Zx사용한 MassStorage 타입 : SD, NandFlash, InterFlash mass_mal.c에서 수정 #include "stm32f10x.h"#include "stdio.h"#include "bsp_sdio_sd.h"#include "usr_nand.h"#include "mass_mal.h" #include "usr_led.h"#include "usr_uart.h" //#define MASSPRINT DEBUGPRINT#define MASSPRINT(...) typedef enum _MASS_ID{MASS_SD = 0,MASS_NAND = 1,MASS_INTERNNAL = 2,}MASS_ID_E; #define MAL_OK 0#define MAL_FAIL 1..

USB Composite

ConfigDescriptor의 설정과 다른 Endpoint에서 값을 가져오는 경우를 주의하여야 할 것 같습니다. 빠르게 짜려고 긁어오다가 주로 실수하는 부분이라서... USB Composite 드라이버를 올려야 해서 Endpoint를 더 가져올 경우 /*-----------------------------------------------------------*/usb_conf.h에서 사용할 Endpoint In/Out EPx_xxx_Callback 함수 주석처리Endpoint ADDR을 추가 #define BTABLE_ADDRESS (0x00) /* EP0 *//* rx/tx buffer base address */#define ENDP0_RXADDR (0x18)#define ENDP0_TXADDR (..

error C1189: #error : MFC does not support WINVER less than 0x0501.

Custom_HID PC 프로그램 예제에서 에러문제 error C1189: #error : MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header. c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afxv_w32.h 40 1 UsbHidDemonstrator USB HID Demonstrator\src\StdAfx.h 에서 아래의 부분을 수정하여야 합니다. #define WINVER 0x0500=> 수정#define WINVER 0x0A00 참고 ..

Buzzer Melody

Buzzer Melody 예제입니다.멜로디를 위한 테스트 예제로 참고만 하면 될 것 같습니다. void TIM2_Configuration(void){TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;NVIC_InitTypeDef NVIC_InitStructure; /* TIM2 clock enable */RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); /* Time base configuration */TIM_TimeBaseStructure.TIM_Period = 10; // Overflow Interrupt On 10 usec 타이머주기TIM_TimeBaseStructure.TIM_Prescaler = 35; // Timer..

STM32L432 Read Protection 버그인가?

STM32L432가 저가의 제품이라 사용하려고 하고 있습니다. 그런데 Read Protect 기능을 사용하면 기존에 라이팅 되어 있는 프로그램이 다 사라집니다. 당황스럽네요. STM32F1XX 제품군에서 확인하면 괜찮은데 이 제품에서만 그러네요.(사라진게 아니라 동작을 안한거였슴니다) 놀랍습니다.어제 질문글을 올렸는데 오늘 답변이 왔네요.니가 무슨말 하는지 모르겠다라구요.. ㅠㅠ제 영어실력이 딸려서 ㅠㅠ어제까지만 해도 비관적 안티였었는데 하루만에 ST 찬양합니다.그 후에 20분 간격으로 답변을 주고 받을 수 있었습니다.채팅하는 줄.... Dear customer, In relation to the read out protection in the reference manual of STM32L432KC, ..

STM32L4xx에서 Brownout, ReadOut Protection 설정

#define USRCONFIGMASK 0xFFFFF8FF#define BORLEVELMASK 0x00000700 #define BORLEVEL OB_BOR_LEVEL_1#define BOR_FLAG_TIMEOUT 1000 #define RDPLEVEL OB_RDP_LEVEL_1 /******************************************************************************** Function Name : * Parameters : None* Return : None* Description : *******************************************************************************/void Config_B..

Invasive Attack

금번에 세미나를 다녀왔습니다. 주제중에서 Invasive Attack(Invasive Attack, Semiinvasive attack, Non invasive attack)과 관련된 내용이 있었는데 클럭 어택과 관련한 내용이 흥미로웠습니다.(연구하시는 분들은 예전부터 알고 계셨겠지만 전 처음이었습니다.) X-TAL의 클럭 입력에서 클럭에 노이즈를 넣으면(한 클럭이 들어가야하는 데 클럭 노이즈를 실어서 2클럭을 집어넣는 경우 같은) 명령어를 뛰어넘어서 처리하는 경우가 있다는 설명이었습니다. 대표적인게 if, else 구문인데요. 편하게 8비트 어셈인 PIC로 비교하면 f레지스터의 비트 b가 0이면 GOTO exit로 가고 그렇지 않으면 GOTO loop로 가는 명령이 있습니다. if else로 프로그램으..

STM32L4 ADC Low Layer Driver

Low Layer Driver을 사용한 ADC 들어오는 ADC 값의 움직임을 크게 주기 위해 샘플링 주기를 짧게 가져왔습니다.(LL_ADC_SAMPLINGTIME_2CYCLES_5) int main(void) { uint32_t nBuf[128]; uint8_t i; /* Configure the system clock to 80 MHz */ SystemClock_LLConfig(); /* ADC Configuration */ ADC_Configuration(); while(1){ GetADC1(chBuf); for(i = 0; i< 11; i++){ UART1_printf("ADC0 =%02X \r\n", chBuf[i]); } } } #include "math.h" #include "usr_adc.h..