User forums > Embedded development
A simple MCS51 project wizard
scarphin:
I tried to implement a simple mcs51 project wizard for the mcs51 architecture using sdcc but I have some problems I need help with. I attached the current files as a zip file in case anyone needs to have a look. Here is a summary of what I've done:
1- I modified the 'common_functions.script' file to include 'sdcc' specific options.
2- I created the 'wizard.script' and 'wizard.xrc' files with simple .png files made on the fly.
3- I modified the 'config.script' file to include my template.
The wizard creates the project files with correct settings corresponding 'debug' and 'release' targets but I couldn't manage to make the assembler assemble the .asm file created. I tried changing the output directory and the object file output directory to the source directory with no luck. I guess there is something with how cb passes directories to the compiler or about some missing settings I failed to implement in the wizard. Here is what I get when I try to build the project. Any help?
--- Code: ---sdcc.exe -mmcs51 -Wall --model-small --debug -IC:\GNU\SDCC\include -c main.c -o obj\Debug\main.rel
sdas Assembler V02.00 + NoICE + SDCC mods + Flat24 (Intel 8051)
Usage: [-Options] file
Usage: [-Options] outfile file1 [file2 file3 ...]
-d Decimal listing
-q Octal listing
-x Hex listing (default)
-j Add line number and debug information to file
-g Undefined symbols made global
-a All user symbols made global
-l Create list output file1[lst]
-o Create object output file1[rel]
-s Create symbol output file1[sym]
-c Generate sdcdb debug information
-p Disable listing pagination
-w Wide listing format for symbol table
-z Enable case sensitivity for symbols
-f Flag relocatable references by ` in listing file
-ff Flag relocatable references by mode in listing file
-I Add the named directory to the include file
search path. This option may be used more than once.
Directories are searched in the order given.
removing
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
--- End code ---
P.S: I tried not to use tabs and I apologize if I missed any. Thnx...
Edit: Here is the simple code I'm trying to build.
--- Code: ---#include <mcs51/8051.h>
void main(void)
{
// Insert code
while(1)
P0^=0x01;
// return;
}
--- End code ---
scarphin:
After a little debugging I realized the problem resides with the '-Wall' command line option. Somehow this option stops the compilation process at the assembly phase. I've posted about this on the sdcc forum and disabled the warning messages in the wizard. As of now it's a working template attached for ur consideration. Thnx...
pebri86:
thank you...this's really what i looking for...
scarphin:
I added the patch and the '.png' files zipped in one.
oBFusCATed:
There is a typo:
--- Code: ---@@ -509,7 +518,7 @@
local pf = prj.AddFile(tgtidx, the_file);
GetProjectManager().RebuildTree(); // make sure our view is current
- // if the file was added successfully, (...)
+ // if the file was added succesfully, (...)
if (!IsNull(pf))
{
// add to this file the rest of the selected targets...
--- End code ---
And an unrelated change:
--- Code: ---@@ -35,7 +35,8 @@
RegisterWizard(wizProject, _T("gtk"), _T("GTK+ project"), _T("GUI"));
RegisterWizard(wizProject, _T("irrlicht"), _T("Irrlicht project"), _T("2D/3D Graphics"));
RegisterWizard(wizProject, _T("lf"), _T("Lightfeather project"), _T("2D/3D Graphics"));
- RegisterWizard(wizProject, _T("matlab_csf"), _T("Matlab project"), _T("Console"));
+ if (PLATFORM == PLATFORM_MSW)
+ RegisterWizard(wizProject, _T("matlab_csf"), _T("Matlab project"), _T("Console"));
RegisterWizard(wizProject, _T("opengl"), _T("OpenGL project"), _T("2D/3D Graphics"));
RegisterWizard(wizProject, _T("ogre"), _T("Ogre project"), _T("2D/3D Graphics"));
RegisterWizard(wizProject, _T("plugins"), _T("Code::Blocks plugin"), _T("Code::Blocks"));
--- End code ---
And commented code, which has to be removed/fixed:
--- Code: ---+// WarningsOn(project, Wizard.GetCompilerID());
--- End code ---
Also does this work on Linux? Is this platform programmable on Linux?
If yes, this line should be made cross platform:
--- Code: ---+ pb_hex = _T("cmd /c \"packihx <$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).ihx >$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).hex\"");
--- End code ---
I've not run the wizard, so I can't tell if it works.
Also can you explain why you're changing the common script?
Navigation
[0] Message Index
[#] Next page
Go to full version