SPeriDLL, is a synonym for 'Sample Peripheral DLL' ,it is used by VC6.0, Can I develope the AGSI function by Borland C++ builder 5.0? I wish do it !
"SPeriDLL, is a synonym for 'Sample Peripheral DLL' ,it is used by VC6.0" Actually, it's used by uVision; VC is just the tool used by Keil to develop it (or the examples in App Notes, at least). Anyway, you got me interested and I had another go at the conversion from MSVC to BCB: The easiest utility is vctobpru (probably in your CBuilder5\Bin folder) - see the Command Line Tools help file. As mentioned before, the Project all compiles OK, but the build fails with a Linker error. The link error is: [Linker Fatal Error] Fatal: Unable to open file 'ODBCCP32.LIB' To fix this: View/Project Manager Right-click SPeriDLL.dll Edit Option Source - opens a text edit page for SPeriDLL.bpr.xml In the <LINKER> section, find the <ALLLIB ...> entry, and remove odbccp32.lib Save the file, and close the Project. Reopen the Project, and it should build OK. (The .bpr Project file is actually just the XML text - so you could probably edit it straight in Notepad) However, using the resulting DLL in uVision v2.07 gives this warning: The specified DLL is not complete: c:\program files\Keil\C51\BIN\SPeriDLL.dll Continuing without specified peripheral... and the DLL then crashes with:
UV2 caused an invalid page fault in module SPERIDLL.DLL at 0167:02acbce7. Registers: EAX=0088ed88 CS=0167 EIP=02acbce7 EFLGS=00010202 EBX=00000000 SS=016f ESP=0088ed14 EBP=0088ed1c ECX=02b0a6ac DS=016f ESI=00000001 FS=0d9f EDX=02b0a6ac ES=016f EDI=02af80c0 GS=0000 Bytes at CS:EIP: 3b 73 0c 7c 18 68 fe 00 00 00 68 c4 a5 af 02 e8 Stack dump: 00000020 02b0a8c8 0088ed5c 02acbc7a 00000000 00000001 00000020 02af80c0 0088ed88 02aed087 02afa700 0088ed2c 00000000 0088ed7c 02aed087 00000000
UV2 caused an invalid page fault in module SPERIDLL.DLL at 0167:02acbce7. Registers: EAX=0088e700 CS=0167 EIP=02acbce7 EFLGS=00010202 EBX=00000000 SS=016f ESP=0088e684 EBP=0088e68c ECX=02b0a6ac DS=016f ESI=00000001 FS=0d9f EDX=02b0a6ac ES=016f EDI=00000000 GS=0000 Bytes at CS:EIP: 3b 73 0c 7c 18 68 fe 00 00 00 68 c4 a5 af 02 e8 Stack dump: 00000000 02b0a8c8 0088e6cc 02acbc7a 00000000 00000001 00000000 00000000 0088e700 02aed087 02afa700 0088e69c 00000000 4956555c 4e4f4953 00000000
Thanks. RE: I think I have to write the code by BCB on a new score . I will try rewrite the code by BCB,but I have some question. Can you help me? Which file contain the AGSI function ? uV2.exe ,S8051.DLL or DP51.DLL? I want to use the AGSI function to code a program simulate the LCD display. The program read the XDATA RAM (LCD dispaly buff 1:1),and display the buff as an bmp picture. If you have some note please tell me ,Thanks.
This is the word from Keil: "really, you will get many problems when you are using Borland C++ to interface with uVision2. Therefore you should not try to track all problems, since you will loose months this way (that is at least our experience)."
"Which file contain the AGSI function? uV2.exe ,S8051.DLL or DP51.DLL?" I think AGSI is not so much a "function" as an "interface" - rather like the "plug-ins" for Browsers? The interface is described in the Keil App Note 154, "Implementing DLLs for User-defined Simulation" http://www.keil.com/appnotes/docs/apnt_154.asp I guess you've already seen it?
Yes,I have read the doc already. If you do it with BCB,Please tell me your experience with e-mail c51@yeah.net . Thanks.
the resulting DLL in uVision v2.07 gives this warning: The specified DLL is not complete: c:\program files\Keil\C51\BIN\SPeriDLL.dll Continuing without specified peripheral... I have found that DLL export names have the underscore prefix; eg, _AgsiEntry. If I turn off underscore generation, it won't link to the RTL funtions (_sprintf, etc). If you're familiar with BCB5, do you know how I can turn off the underscore generation for just AgsiEntry?
OK, I fixed that one as follows: 1. Build the DLL using BCB 2. Generate a Module Definition File using
impdef -a SPeriDLL.def SPeriDLL.dll
EXPORTS AgsiEntry=_AgsiEntry @1
I'm looking forward to your succeed.