scootley DD-WRT Novice
Joined: 14 Nov 2009 Posts: 17
|
Posted: Thu Jan 07, 2010 8:07 Post subject: |
|
Here are some more detailed compilation instructions
1. Determine the correct IO start address for your port. For my port, Windows Device Manager listed 2 ranges, and the correct address for tjtag was the start address of the second range, not the first range. That is, my ranges were CFF4-CFF7 and CFF8-CFFF, and the tjtag address to use was CFF8 (the start address of the second/higher range). I don't know if this is always the case.
2. In Visual C++, go to File -> New -> Project ...
3. On the left, under "Project types", choose "Visual C++: Win32"
4. On the right, under "Templates", choose "Win32 Console Application"
5. Give the project a name at the bottom, such as tjtag (this example assumes this name)
6. Note the folder where the project is being created
7. Click OK
8. The Win32 Application Wizard will open
9. Click Finish
10. The new project will open
11. In the Solution Explorer on the left, open tjtag.cpp under "Solution/tjtag/Source Files"
12. Replace the entire contents of this file with the contents of tjtag.c from the tjtag 3-0-1 source
13. Change 0x378 to 0xCFF8 on line 513, 524. In your case, use the address you determined in step 1.
14. Change 0x379 to 0xCFF9 on line 530. In your case, use the address you determined in step 1 plus 1 (hex).
15. Change <inttypes.h> to "inttypes.h" (include the quotes, remove the <>) on line 28
16. At line 9, insert this include: #include "stdafx.h"
17. Copy spi.h and tjtag.h from the tjtag 3-0-1 source to the same folder as your project source files (...\Projects\tjtag\tjtag\)
18. In the Solution Explorer on the left, right-click on "Header Files" and select Add -> Existing Item...
19. Pick the spi.h and tjtag.h files that you just copied
20. Download inttypes.h and stdint.h from http://code.google.com/p/msinttypes/ and place them in the same folder (...\Projects\tjtag\tjtag\)
Code: | You can use these URLS:
http://msinttypes.googlecode.com/svn/trunk/stdint.h
http://msinttypes.googlecode.com/svn/trunk/inttypes.h |
21. In the Solution Explorer on the left, right-click on "Header Files" and select Add -> Existing Item...
22. Pick the inttypes.h and stdint.h files that you just downloaded
23. In the Solution Explorer on the left, right-click on tjtag (the project, not the solution), and select Properties
24. On the left, under "Configuration Properties", select "General"
25. On the right, where it says "Character Set", select "Use Multi-Byte Character Set"
26. On the left, under "Configuration Properties/C/C++, select 'Preprocessor"
27. On the right, where it says "Preprocessor Definitions", add ";WINDOWS_VERSION"
28. Click OK
29. In the menu, select Build->Build Solution
30. The output window at the bottom should show this:
Quote: | 1>------ Build started: Project: tjtag, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>tjtag.cpp
You will see 142 warnings of the following types:
... : warning C4018: '<' : signed/unsigned mismatch
... : warning C4996: 'XXX': This function or variable may be unsafe. Consider using XXX_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
... : warning C4244: '=' : conversion from 'double' to 'time_t', possible loss of data
... : warning C4996: 'XXX': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _XXX. See online help for details.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\Users\XXX\Documents\Visual Studio 2008\Projects\tjtag\tjtag\Debug\BuildLog.htm"
1>tjtag - 0 error(s), 142 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== |
31. Your build was successful if you see the above.
32. The executable will be at ...\Projects\tjtag\Debug\tjtag.exe
33. Remember to execute it as an admin
Note: There are some other instances of the IO start address on lines 49 and 50 of tjtag.h in the #define's for DATA_PORT and STATUS_PORT, but these are unused and so there is no need to change them. |
|