2013년 10월 28일 월요일

Cortex-M3 특징(1)


  • stack pointer 가 0 번지에 있고, Reset handler 가 4 번지에 있어서 스텍 주소를 초기화 한 후 리셋 핸들러가 실행된다.
  • 인터럽트가 걸리면 r0, r1, r2, r3, r12,lr, pc, psr 은 하드웨어가 자동으로 스택에 저장하고, 인터럽트 루틴으로 들어온다.
    • 소프트웨어에서 r4, r5, r6, r7, r8, r9, r10, r11 을 스택에 백업하면 된다.

2013년 10월 15일 화요일

cygwin-gcc와 Mingw 에서 한글 코드 문제에 대한 메모

한글 관련 프로그램을 만들어 보려고, 윈도우 7 환경에서 Mingw 로 작업을 시작 했다.

윈도우 콘솔 프로그램으로 동작시키려고, 프로그래밍을 하는 과정에서 한글 출력하는 문제에 봉착 했다.

Mingw 에서는 C 소스가 UTF-8 코드로 작성되면 한글이 깨지고, CP949 소스는 잘 출력 된다.

그런데 cygwin-gcc 는 반대로 CP949 소스로 작성하면 한글이 깨지고, UTF-8 소스는 잘 출력된다.

윈도우의 CMD 까지 코드페이지를 변경하면서 테스트 하니, 갈 수록 헷갈린다.

뭐가 맞는건지 잘 모르지만 지금까지 파악한 사항은 위와 같다.

한글 처리가 시작부터 이렇게 어렵다니...


2013년 8월 30일 금요일

wxWidgets (10) Good reference link.

For build development environment of wxWidgets : http://szmyoung.blogspot.kr/2009/03/windows-wxwidgets.html

wxWidgets (9) Set environment for the project.

1. Setting - Global variables...



2. Create "wx" that is "Current Variable".


3. Select the folder of wxWidgets.

  base : C\wxWidgets-2.8.12
  include : C\wxWidgets-2.8.12\include
  lib : C:\wxWidgets-2,8,12\lib\gcc_lib


4. Setting - Compiler...


5. Set the compiler include folder


6. Set the library folder for the linker.


7. Add an option "-static".


8. Build and run


9. We are completed to build the project.



wxWidgets (8) Created the project.

Previously compile environment installed.

Now creat the project.

1. Run Codeblocks.


2. Click Next at Welcome message.


3. Select wxWidgets 2.8.x


4. Set the project name and folder.


5. Edit the author information. I have skipped. Click Next.


6. Select wxFormBuilder and the application type.



7. Select the wxWidgets folder.



8. Select Debug and/or Release.


9. Select the method to link the libraries.


10. Select additional libraries. I have skipped because didn't necessary now.


11. We have created the project.


Next time, I will set some environment for the project.

2013년 8월 29일 목요일

wxWidgets (7) Retry to Install the toolkit for wxWidgets in MS Windows.

I have fault to compile a wxWidget application by wxPack.

So I decided to compile wxWidget source by Mingw.


1. Install Mingw

I have installed tdm-gcc-4.7.1-2.exe (the latest version). It is easy to install.

link : http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%204.7%20series/4.7.1-tdm-1%20SJLJ/


2. Install wxWidget source

I installed wxMSW

You can download wxMSW-2.8.12-Setup.exe on the link below.

link : http://www.wxwidgets.org/downloads/#latest_stable


And Install the package.


3. Compile the wxWidget

I wanted to use standalone executable file that was static compile file.

So I compiled wxWidget by static.


I edited batch files to build wxWidget.


"build_release.bat"


mingw32-make SHELL=CMD.exe -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release clean
pause
mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release
pause


and "build_debug.bat"


mingw32-make SHELL=CMD.exe -f makefile.gcc SHARED=0 UNICODE=1 BUILD=debug clean
pause
mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc SHARED=0 UNICODE=1 BUILD=debug
pause


I copied batch files into C:\wxWidgets-2.8.12\build\msw\




And I run build_debug.bat and build_release.bat

Wait..
Wait..

Hum...

It's done about 20 minutes.


Congratulation !! We are completed to install wxWidget toolchain.

wxWidgets (6) I give up wxPack

I give up using wxPack. Because I could not compile the application by wxPack.

wxPack was built by tdm-gcc-4.4.1-dw2.

I have not found out where tdm-gcc-4.4.1-dw2 install package.

At least I will try to compile the wxWidgets source.

Okay. Let's go. :(

2013년 8월 28일 수요일

wxWidgets (5) undefined reference to '_Unwind_Resume'

The error was occurred because was not linked libgcc.a

To solve the problem, I have added the folder of mingw/include and mingw/lib




But the problem still remains.

wxWidgets (4) Why did the error occur?

I installed wxPack v2.8.12_07

I have seem somewhere that you must install Mingw have compiled wxPack.

I will remove the Codeblocks and Mingw that have installed before. And I will install Mingw as the same version compiled wxPack.

Change the language in this blog.

In this blog, I change the language from Korean to English. Because now is the area of globalization.

But I cannot enough to speak English well. So I will study and try to write in English.

wxWidgets (3) 최초 빌드

지난 글에서는 프로젝트를 생성 했습니다.

이번에는 생성된 프로젝트를 빌드해 보겠습니다.


이렇게 메뉴에서 빌드 하면 됩니다.

자! 결과는 어떻게 될까요?

||=== test, Release ===|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_gdicmn.o):gdicmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_datacmn.o):datacmn.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplevel.o):toplevel.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_toplvcmn.o):toplvcmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_dlgcmn.o):dlgcmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_dialog.o):dialog.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_window.o):window.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp|| more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28u_core.a(corelib_msw_control.o):control.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (0 minutes, 15 seconds) ===|

요렇게 에러 메시지가 우르르 올라 옵니다.

고객님! 당황하셨어요? 저도 당황스럽습니다. 

다음에 이 문제를 해결해 보도록 하겠습니다.

wxWidgets (2) 프로젝트 생성

지금 쓰고 있는 글은 제 자신이 wxWidget 을 공부해 가면서 정리하는 내용입니다. 틀린 부분이 발생할 수 있습니다.

이번에는 wxWidget 프로젝트를 생성해 봤습니다.

저는 스테틱 형식으로 링크하려 합니다. dll 별로 안좋아 합니다.

자! 시작해 볼까요.

1. 프로젝트를 생성하기
  아래 그림과 같이 codeblocks 를 시작하면 Create a new project 가 나타나는데 클릭!
  그리고 wxWidgets project 선택.


2. Welcom 뭐라 뭐라 하는게 그냥 Next


3. wxWidgets 2.8.x 선택
  제가 설치한 wxPack 에는 2.8.2 가 설치 되어 있던것 같습니다.


4. 프로젝트 이름 및 폴더 선택


5. 개발자 정보
  저는 귀찮아서 패스


6. wxPack 에느 wxFormBuilder 가 포함되어 있습니다. 
  wxFormBuilder와 Dialog Based 선택


7. wxWidgets 라이브러리가 있는 폴더 선택


8. 컴파일러와 생성할 프로젝트 유형 선택 (뭐 그림보면 압니다. 그림 보고도 모르셔도 할 수 없네요^^;;)


9. 실행 파일 및 라이브러리 참조 방법 선택


10. 추가 라이브러리 선택
  지금은 아무것도 선택 안하고 Next


11. 자 이제 프로젝트가 생성 됐습니다.



위와 같이 소스가 생성된 것을 볼 수 있습니다. 컴파일 결과는 다음 글에 올리도록 하겠습니다.

프로젝트 생성 방법에 선택 사항이 많네요.







wxWidgets (1) 개발환경 구축

1. 개요

MS 윈도우용 프로그램을 만들 일이 가끔 있는데, Visual C++ 을 사용하기에는 알아야 할 것들이 너무 많네요.

그래서 좀 더 익숙한 gcc 를 사용해서 윈도우용 프로그램을 만드는 방법을 이리 저리 검색해보니 저에게 최적의 도구가 있어서 하나 하나 배워가며 설정해 보려 합니다.

그 도구가 바로 wxWidget 라이브러리 입니다.


2. 개발 환경

OS : Windows 7 64bit
IDE & Compiler : Codeblocks 12.11 과 같이 포함된 mingw (gcc)
Library : wxWidget (wxPack 으로 설치)


3. 개발환경 설치

  1) wxPack 설치
  2) Codebolcks 를 설치. 이 때 mingw 가 포함된 패키지로 설치.


4. Codeblocks 컴파일 환경 설정


위와 같이 Codeblocks 메뉴에서 Settings - Global variables... 를 선택하면 Global Variable Editor 창이 뜹니다.


Current Variable 에 wx 를 생성 합니다.



wxWidget 이 설치된 경로를 찾아서 입력해 줍니다.

base :  C:\SourceCode\Libraries\wxWidgets2.8
include : C\SourceCode\Libraries\wxWidgets2.8\include
lib : C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib

여기서  lib 는 dll 을 사용할 지 static 으로 링크할지에 따라서 dll 을 사용할거면 gcc_dll, static 을 사용할거면 gcc_lib 로 지정하시면 되겠습니다.

dll 을 사용할거면 필요한 dll 을 같이 묶어서 실행 파일을 줘야하기 때문에 귀찮아서 저는 static 방식을 선호 합니다.

지금 여기까지가 맞는지는 아직 검증하지 못했습니다.

설정할 것이 조금 더 있는데 더 정리해서 문제있는 부분은 수정할 예정입니다.






카테고리를 이제야 추가 했습니다.

블로그 스팟에 자리잡은지 상당히 오래 됐는데, 첫 인상이 휑한 느낌이어서 별로 정이 안붙었습니다.

그러다 조금 시간 여유가 있어서 조금 만져볼까 하고 여기 저기 검색해서 카테고리를 추가하는 방법을 알았습니다.

글에 테그를 달면 그것을 이용하여 블로그스팟의 가젯을 추가하여 카테고리 기능을 할 수 있네요.

자세한 글은

http://goodinfolog.blogspot.kr/2013/07/blog-post_3567.html

에 있습니다.

[C#] Community Toolkit

 https://kaki104.tistory.com/806