arpruss / mouse3d_stm32f1

MIT License
13 stars 2 forks source link

Compilation aborts #2

Closed Madtricksystem closed 4 years ago

Madtricksystem commented 4 years ago

Hi, I also have a problem to get the software on the board STM32F103C8T6. Blue board with 5VDC pin.

I have checked the first thread about the compilation problem. But the error messages look different.

Prerequisites: STM32F103C8T6 blue board Bootloader flashed via CH340G Installation of Arduino IDE with all necessary libraries

I followed the instructions in the manual: Basic Instructions: https://www.instructables.com/id/SpaceBall-4000-Serial-to-USB-Adapter/ and step 1 and 2: https://www.instructables.com/id/Gamecube-Controller-USB-Adapter-and-Getting-Starte/

I installed the libraries and required software (GitHub) in the latest versions, or copied them into the appropriate directories following the instructions.

The compilation terminates with the following error message:

*Arduino: 1.8.12 (Windows 10), Board: "Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), STM32duino bootloader, Serial"

Warnung: platform.txt aus dem Kern 'STM32 Boards (STM32duino.com)' enthält veraltete recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" und wurde automatisch zu recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" konvertiert. Erwägen Sie eine Aktualisierung dieses Kerns. mouse3d:173:1: error: 'USBHID' does not name a type

USBHID HID;

^~ mouse3d:230:22: error: expected ')' before '&' token HIDMouse3D(USBHID& HID) ^

C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: In member function 'void HIDMouse3D::begin()': mouse3d:252:7: error: 'HID' was not declared in this scope HID.addOutputBuffer(&ledData);

   ^~~

C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: At global scope: mouse3d:266:20: error: expected ')' before '&' token HIDJoy3D(USBHID& HID) ^

C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: In member function 'void HIDJoy3D::begin()': mouse3d:278:7: error: 'HID' was not declared in this scope HID.addOutputBuffer(&ledData);

   ^~~

C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: At global scope: mouse3d:283:20: error: 'HID' was not declared in this scope HIDMouse3D Mouse3D(HID);

                ^~~

mouse3d:284:16: error: 'HID' was not declared in this scope HIDJoy3D Joy3D(HID);

            ^~~

C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: In function 'void startMouse3D()': mouse3d:292:3: error: 'HID' was not declared in this scope HID.clearBuffers();

^~~ C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: In function 'void startJoy3D()': mouse3d:311:3: error: 'HID' was not declared in this scope HID.clearBuffers();

^~~ C:\Users\madtr\Projekte\Arduino\mouse3d\mouse3d.ino: In function 'void setMode(uint8)': mouse3d:373:7: error: 'HID' was not declared in this scope HID.end();

   ^~~

mouse3d:381:7: error: 'HID' was not declared in this scope HID.end();

   ^~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino: In function 'bool erasePage(uint32_t)': eeprom8:37:30: error: '__IO' was not declared in this scope

define GET_WORD(address) ((__IO uint32_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:59:38: note: in expansion of macro 'GET_WORD' return success && EEPROM8_MAGIC == GET_WORD(base);

                                  ^~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:37:30: note: suggested alternative: '__tm'

define GET_WORD(address) ((__IO uint32_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:59:38: note: in expansion of macro 'GET_WORD' return success && EEPROM8_MAGIC == GET_WORD(base);

                                  ^~~~~~~~

eeprom8:37:35: error: expected ')' before 'uint32_t'

define GET_WORD(address) ((__IO uint32_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:59:38: note: in expansion of macro 'GET_WORD' return success && EEPROM8_MAGIC == GET_WORD(base);

                                  ^~~~~~~~

eeprom8:59:52: error: expected ')' before ';' token return success && EEPROM8_MAGIC == GET_WORD(base); ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino: In function 'int EEPROM8_getValue(uint8_t)': eeprom8:35:30: error: '__IO' was not declared in this scope

define GET_BYTE(address) ((__IO uint8_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:74:9: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(base+offset) == variable) {

     ^~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:35:30: note: suggested alternative: '__tm'

define GET_BYTE(address) ((__IO uint8_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:74:9: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(base+offset) == variable) {

     ^~~~~~~~

eeprom8:35:35: error: expected ')' before 'uint8_t'

define GET_BYTE(address) ((__IO uint8_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:74:9: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(base+offset) == variable) {

     ^~~~~~~~

eeprom8:77:3: error: expected ')' before '}' token } ^

eeprom8:77:3: error: expected ')' before '}' token eeprom8:77:3: error: expected primary-expression before '}' token C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino: In function 'bool writeHalfWord(uint32_t, uint16_t)': eeprom8:36:35: error: '__IO' was not declared in this scope

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:92:21: note: in expansion of macro 'GET_HALF_WORD' return success && GET_HALF_WORD(address) == halfWord;

                 ^~~~~~~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:36:35: note: suggested alternative: '__tm'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:92:21: note: in expansion of macro 'GET_HALF_WORD' return success && GET_HALF_WORD(address) == halfWord;

                 ^~~~~~~~~~~~~

eeprom8:36:40: error: expected ')' before 'uint16_t'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                                    ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:92:21: note: in expansion of macro 'GET_HALF_WORD' return success && GET_HALF_WORD(address) == halfWord;

                 ^~~~~~~~~~~~~

eeprom8:92:55: error: expected ')' before ';' token return success && GET_HALF_WORD(address) == halfWord; ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino: In function 'boolean EEPROM8_storeValue(uint8_t, uint8_t)': eeprom8:36:35: error: '__IO' was not declared in this scope

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:106:9: note: in expansion of macro 'GET_HALF_WORD' if (GET_HALF_WORD(base+offset) == 0xFFFF) {

     ^~~~~~~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:36:35: note: suggested alternative: '__tm'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:106:9: note: in expansion of macro 'GET_HALF_WORD' if (GET_HALF_WORD(base+offset) == 0xFFFF) {

     ^~~~~~~~~~~~~

eeprom8:36:40: error: expected ')' before 'uint16_t'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                                    ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:106:9: note: in expansion of macro 'GET_HALF_WORD' if (GET_HALF_WORD(base+offset) == 0xFFFF) {

     ^~~~~~~~~~~~~

eeprom8:109:3: error: expected ')' before '}' token } ^

eeprom8:109:3: error: expected ')' before '}' token eeprom8:109:3: error: expected primary-expression before '}' token eeprom8:36:35: error: '__IO' was not declared in this scope

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:126:14: note: in expansion of macro 'GET_HALF_WORD' data = GET_HALF_WORD(base+offset);

          ^~~~~~~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:36:35: note: suggested alternative: '__tm'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:126:14: note: in expansion of macro 'GET_HALF_WORD' data = GET_HALF_WORD(base+offset);

          ^~~~~~~~~~~~~

eeprom8:36:40: error: expected ')' before 'uint16_t'

define GET_HALF_WORD(address) ((__IO uint16_t)(address))

                                    ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:126:14: note: in expansion of macro 'GET_HALF_WORD' data = GET_HALF_WORD(base+offset);

          ^~~~~~~~~~~~~

eeprom8:126:40: error: expected ')' before ';' token data = GET_HALF_WORD(base+offset); ^

eeprom8:35:30: error: '__IO' was not declared in this scope

define GET_BYTE(address) ((__IO uint8_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:132:13: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(otherBase+j) == variable)

         ^~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:35:30: note: suggested alternative: '__tm'

define GET_BYTE(address) ((__IO uint8_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:132:13: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(otherBase+j) == variable)

         ^~~~~~~~

eeprom8:35:35: error: expected ')' before 'uint8_t'

define GET_BYTE(address) ((__IO uint8_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:132:13: note: in expansion of macro 'GET_BYTE' if (GET_BYTE(otherBase+j) == variable)

         ^~~~~~~~

eeprom8:133:16: error: expected ')' before ';' token break; ^

eeprom8:133:16: error: expected ')' before ';' token C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino: In function 'void EEPROM8_init()': eeprom8:37:30: error: '__IO' was not declared in this scope

define GET_WORD(address) ((__IO uint32_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:164:24: note: in expansion of macro 'GET_WORD' if (EEPROM8_MAGIC != GET_WORD(EEPROM_PAGE0_BASE) && ! erasePage(EEPROM_PAGE0_BASE) ) {

                    ^~~~~~~~

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:37:30: note: suggested alternative: '__tm'

define GET_WORD(address) ((__IO uint32_t)(address))

                          ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:164:24: note: in expansion of macro 'GET_WORD' if (EEPROM8_MAGIC != GET_WORD(EEPROM_PAGE0_BASE) && ! erasePage(EEPROM_PAGE0_BASE) ) {

                    ^~~~~~~~

eeprom8:37:35: error: expected ')' before 'uint32_t'

define GET_WORD(address) ((__IO uint32_t)(address))

                               ^

C:\Users\madtr\Projekte\Arduino\mouse3d\eeprom8.ino:164:24: note: in expansion of macro 'GET_WORD' if (EEPROM8_MAGIC != GET_WORD(EEPROM_PAGE0_BASE) && ! erasePage(EEPROM_PAGE0_BASE) ) {

                    ^~~~~~~~

eeprom8:168:3: error: expected ')' before 'if' if (EEPROM8_MAGIC != GET_WORD(EEPROM_PAGE1_BASE) && ! erasePage(EEPROM_PAGE1_BASE) ) {

^~ eeprom8:172:3: error: expected ')' before 'if' if (GET_HALF_WORD(EEPROM_PAGE0_BASE+4) != 0xFFFF) {

^~ exit status 1 'USBHID' does not name a type *

What could be wrong here? Do you need to install other versions? Or have I basically done something wrong?

It was right that the CH340G was only for the bootloader. And the board is loaded with the software via USB. Or does it have to be different?

In any case, the compilation should run through...

Who can help?

It would be a pity if this project would fail now. I think it's great.

arpruss commented 4 years ago

It's looking to me like you've got the wrong version of the USB Composite library (perhaps a super-early version). I don't know when you downloaded the core. The library included in the core was updated over the weekend. So, I suggest you get the latest version of Roger's core from github.

Did you download the USB Composite library separately from the core? It should be included inside the core.

If it still doesn't work, send me a complete log of your build: In Arduino, do File | Preferences | Show verbose output during: [check] compilation.

Madtricksystem commented 4 years ago

Wow. Thanks for your quick response.

It's looking to me like you've got the wrong version of the USB Composite library (perhaps a super-early version). I don't know when you downloaded the core. The library included in the core was updated over the weekend. So, I suggest you get the latest version of Roger's core from github.

It could be. I followed the zip link in the instructions and ended up in your GitHub. I downloaded this core. I just took the ZIP file from Rogers GitHub and unzipped it into the directory. Now Arduino is compiling IDE too.

Did you download the USB Composite library separately from the core? It should be included inside the core.

Yes, I had done that. I see it is now actually included in Roger's zip file.

If it still doesn't work, send me a complete log of your build: In Arduino, do File | Preferences | Show verbose output during: [check] compilation.

Okay. I'll do that. Now Arduino IDE can't find the interface. One problem solved and the next one appears.

Now how should the developer board be connected to the computer? Directly via USB or via the CH240G, so that the compiled project can get on the board?

Here is the error message: Der Sketch verwendet 23052 Bytes (35%) des Programmspeicherplatzes. Das Maximum sind 65536 Bytes. Globale Variablen verwenden 5096 Bytes (24%) des dynamischen Speichers, 15384 Bytes für lokale Variablen verbleiben. Das Maximum sind 20480 Bytes. maple_loader v0.1 Resetting to bootloader via DTR pulse Searching for DFU device [1EAF:0003]... dfu-util - (C) 2007-2008 by OpenMoko Inc. Couldn't find the DFU device: [1EAF:0003] This program is Free Software and has ABSOLUTELY NO WARRANTY

arpruss commented 4 years ago

So, now it's compiled ok? What did you change? Yes, connect it directly with USB.

Madtricksystem commented 4 years ago

Sorry. My answer was not formatted correctly. I have corrected it. Please check my last answer again.

Madtricksystem commented 4 years ago

Now I took the GitHub source from Roger. I removed the USBHID folder. And then I did it. Except the upload on the Arduino isn't done yet...

arpruss commented 4 years ago

Plug the board into USB. Then start the Windows device manager (Windows-R, devmgmt.msc). Expand the Ports section and see the device has shown up. If not, here are two possibilities:

  1. The bootloader didn't upload correctly.
  2. Your computer needs the board to have the correct USB resistor.
Madtricksystem commented 4 years ago

Okay. Compiled again and this time the upload to the board "maybe" worked. I think there was an error message in the log after all. I'll append it again. Can you see if that's correct?

Anyway, the green LED on the board now lights up in addition to the red LED.

Madtricksystem commented 4 years ago

Der Sketch verwendet 23052 Bytes (35%) des Programmspeicherplatzes. Das Maximum sind 65536 Bytes. Globale Variablen verwenden 5096 Bytes (24%) des dynamischen Speichers, 15384 Bytes für lokale Variablen verbleiben. Das Maximum sind 20480 Bytes. maple_loader v0.1 Resetting to bootloader via DTR pulse Searching for DFU device [1EAF:0003]... Found it!

Opening USB Device 0x1eaf:0x0003... Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=2, name="STM32duino bootloader v1.0 Upload to Flash 0x8002000" Setting Configuration 1... Claiming USB DFU Interface... Setting Alternate Setting ... Determining device status: state = dfuIDLE, status = 0 dfuIDLE, continuing Transfer Size = 0x0400 bytes_per_hash=461 Starting download: [##################################################] finished! error resetting after download: usb_reset: could not reset device, win error: Ein nicht vorhandenes Ger�t wurde angegeben.

state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present

Done! Resetting USB to switch back to runtime mode timeout waiting for COM7 serial

Madtricksystem commented 4 years ago

In the device manager I had a serial interface. This has now disappeared. But now I have two 3Dconnexion interfaces under Input Devices. One is the KMJ Emulator and the other is the SpaceMouse Pro.

Great.

Then it should have worked.

Now I will connect the TTL to RS232 adapter. Then the SpaceBall.

And then test it.

arpruss commented 4 years ago

The error resetting after upload is normal.

arpruss commented 4 years ago

I updated the Instructable not to point to my old version of the core, but to point to Roger's latest core.