Compilation error with MODSEIAL & STM32F401RE

Hello everyone,

Since can I switched to STM32F401RE. Since impossible to compile with MODSERIAL.
Here is the error

MODSERIAL_NUCLEO_F401RE.cpp:5:17: error: 'struct serial_t' has no member named 'index'
 switch( _serial.index ) ```

any hints would be appreciated :slight_smile:

Thanks, Antoine

1 Like

Hello,

please fill in more context.

  • MbedOS version?
  • Build tool? Probably Mbed Studio accoring to the tag

BR, Jan

Hello JohnnyK,

Thanks for the quick feedback.
I’m compiling on MBED Studio
MED OS 5.15.7

Unfortunately I do not have access to Mbed Studio at this moment.
However with KeilStudioCloud and setup below the compilation seems to be OK.

Test code:

#include "mbed.h"
#include "MODSERIAL.h"
MODSERIAL pc(USBTX, USBRX); // tx, rx

int main() {
    pc.printf("Hello World!");
    while(1) {
        pc.putc(pc.getc() + 1);
    }
}

Library: MODSERIAL - MODSERIAL with support for more devices | Mbed

MbedOS 5.15.7 and Nucleo-F401RE as target.

BR, Jan

Thank you for your feedback,

I read somewhere that on MBED Online it works. But I need to compile on Mbed Studio.
Do you know when you will have access to mbed studio?

Thanks in advance

Today later, for approx. 5 hours.

BR, Jan

Perfect, I’ll be patient, see you soon and thanks again for your help.

It seems to be OK also with MbedStudio

BR, Jan

Thank you for your feedback.

Which MODSERIAL version do you use?

I recreated a test code, here’s the result!

Mbed Studio does not know change branches from Mbed’s old repos, so there is available only the Default branch which is probably the last one.

I see only one different thing, your library is copied into project and not imported from repo. When you compare your picture and my one, then you will see differences in Libraries panel and in tree are different icons.

BR, Jan

Thank you for your feedback,

I had noticed the icon difference.

Can you tell me what is in the MODSERIAL_NUCLEO_FRE.cpp file, mine is in the picture below and the problem comes from “.index” underlined in red.

You can see it via link I posted above - MODSERIAL - MODSERIAL with support for more devices | Mbed
And how we can see it is different.

BR, Jan

Thanks a lot JonnhyK, with this new file it works! It compiles without any problem.

I just have to test with the original code, but I’m not afraid.

Many thanks for your help.

Sincerely
Antoine