NUCLEO-L496ZG - clock misconfig
Hi! I'm new to nuttx and have been trying to get it working for the first time on a NUCLEO-L4A6ZG board. I couldn't get the nsh working at first but after measuring a gpio + sleep signal, I found out that the clock is running 20x slower than it should be (a sleep(1) takes 20 secs). Then, if I configure the nsh to use an usart at a baudrate of 115200, I can read it externally with 115200/20 = 5760. I used the nsh config for the NUCLEO-L496ZG which has about the same microcontroller. I'm guessing that it is a clock misconfig given that other demos run 20x slower as well. Where/how can I modify the clock configuration? Cheers
C++ CMake HelloWorld - Sim target
Hello! Could anyone get the C++ CMake HelloWorld example working for the simulator? I'm using the sim:libcxxtest config but am getting the following error: nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’ has not been declared 154 | using ::at_quick_exit; Thanks, Nuno
Re: C++ CMake HelloWorld - Sim target
Hey Flavio :) Yes, I can build and run the helloxx example when it is inside the nuttx/apps tree (I've been using sim:libcxxtest configuration). I'm having problems when trying to build it outside the nuttx tree by using the nuttx-as-library (make export). I followed the C++ CMake example in the documentation and was able to get it working on an STM32 target. However, the build error I mentioned comes up when I set the target to the simulator. I'm not sure if the cmake toolchain is set correctly. I'm using: set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR sim) and set the compiler and tools to standard g++. Cheers, Nuno Em qui., 11 de nov. de 2021 às 20:42, Flavio Castro Alves Filho < flavio.al...@gmail.com> escreveu: > Hello Nuno, > > Before starting working with cmake, it is important that the C++ > configuration in nuttx is building and running. > > Did you get this part working? > > Best regards, > > Flavio > > Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos > > escreveu: > > > Hello! > > > > Could anyone get the C++ CMake HelloWorld example working for the > > simulator? > > I'm using the sim:libcxxtest config but am getting the following error: > > > > nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’ has > not > > been declared > > 154 | using ::at_quick_exit; > > > > Thanks, > > Nuno > > > -- Nuno Bernardes Barcellos *Politecnico di Milano & University of São Paulo* M.Sc. in Electronics Engineering +5534988273589 <+393896649806> | nunobarcel...@gmail.com
Re: C++ CMake HelloWorld - Sim target
Yes, it does. It generates the nuttx-export.zip. Then I set cmake to: include_directories: nuttx-export/include nuttx-export/include/libcxx nuttx-export/arch/chip target_link_libraries: libs under nuttx-export/libs And set the compiler and linker flags at nuttx-export/scripts/Make.defs Nuno Em qui., 11 de nov. de 2021 às 22:15, Flavio Castro Alves Filho < flavio.al...@gmail.com> escreveu: > Hi Nuno, > > So when you run 'make export' the build runs correctly, right? > > Best regards, > > Flavio > > Em qui., 11 de nov. de 2021 às 21:14, Nuno Barcellos > escreveu: > > > > Hey Flavio :) > > > > Yes, I can build and run the helloxx example when it is inside the > > nuttx/apps tree (I've been using sim:libcxxtest configuration). > > > > I'm having problems when trying to build it outside the nuttx tree by > using > > the nuttx-as-library (make export). > > I followed the C++ CMake example in the documentation and was able to get > > it working on an STM32 target. > > However, the build error I mentioned comes up when I set the target to > the > > simulator. > > > > I'm not sure if the cmake toolchain is set correctly. I'm using: > > > > set(CMAKE_SYSTEM_NAME Linux) > > set(CMAKE_SYSTEM_PROCESSOR sim) > > > > and set the compiler and tools to standard g++. > > > > Cheers, > > Nuno > > > > > > > > Em qui., 11 de nov. de 2021 às 20:42, Flavio Castro Alves Filho < > > flavio.al...@gmail.com> escreveu: > > > > > Hello Nuno, > > > > > > Before starting working with cmake, it is important that the C++ > > > configuration in nuttx is building and running. > > > > > > Did you get this part working? > > > > > > Best regards, > > > > > > Flavio > > > > > > Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos < > nunobarcel...@gmail.com > > > > > > > escreveu: > > > > > > > Hello! > > > > > > > > Could anyone get the C++ CMake HelloWorld example working for the > > > > simulator? > > > > I'm using the sim:libcxxtest config but am getting the following > error: > > > > > > > > nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’ > has > > > not > > > > been declared > > > > 154 | using ::at_quick_exit; > > > > > > > > Thanks, > > > > Nuno > > > > > > > > > > > > > -- > > Nuno Bernardes Barcellos > > *Politecnico di Milano & University of São Paulo* > > M.Sc. in Electronics Engineering > > +5534988273589 <+393896649806> | nunobarcel...@gmail.com > > > > -- > Flavio de Castro Alves Filho > > flavio.al...@gmail.com > Twitter: http://twitter.com/#!/fraviofii > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
Re: C++ CMake HelloWorld - Sim target
Hi Flavio, I followed your tip of comparing with the nuttx standard building steps and it did get me further. I saw that there are some startup objects (nuttx-export/startup) that I did not add in the linking phase. There are none for the stm32 export. I'm still getting errors but I'll investigate it further and get back here if I'm stuck or done. Thank you! Em sex., 12 de nov. de 2021 às 18:56, Flavio Castro Alves Filho < flavio.al...@gmail.com> escreveu: > Hello Nuno, > > It is better to post here the cmake files and the compilation execution. > > Now looking at your first email, it seems that the function > 'at_quick_exit' cannot be found by the linker. > > You can look at NuttX code (app and nuttx) and see where this function > is and who is complaining. For a first implementation, maybe the > linked library does not need the library that is causing the issue can > be removed. > > It can be: > * function not compiled during make export > * function not found by cmake-generated linker rule > - the order of the libraries call is important > - when I did for stm32, I looked at the linker call when building > standard NuttX to make the same on Cmake > > Hope it helps. > > Best regards, > > Flavio > > Em qui., 11 de nov. de 2021 às 22:50, Nuno Barcellos > escreveu: > > > > Yes, it does. It generates the nuttx-export.zip. Then I set cmake to: > > > > include_directories: > > nuttx-export/include > > nuttx-export/include/libcxx > > nuttx-export/arch/chip > > > > target_link_libraries: > > libs under nuttx-export/libs > > > > And set the compiler and linker flags at nuttx-export/scripts/Make.defs > > > > Nuno > > > > > > Em qui., 11 de nov. de 2021 às 22:15, Flavio Castro Alves Filho < > > flavio.al...@gmail.com> escreveu: > > > > > Hi Nuno, > > > > > > So when you run 'make export' the build runs correctly, right? > > > > > > Best regards, > > > > > > Flavio > > > > > > Em qui., 11 de nov. de 2021 às 21:14, Nuno Barcellos > > > escreveu: > > > > > > > > Hey Flavio :) > > > > > > > > Yes, I can build and run the helloxx example when it is inside the > > > > nuttx/apps tree (I've been using sim:libcxxtest configuration). > > > > > > > > I'm having problems when trying to build it outside the nuttx tree by > > > using > > > > the nuttx-as-library (make export). > > > > I followed the C++ CMake example in the documentation and was able > to get > > > > it working on an STM32 target. > > > > However, the build error I mentioned comes up when I set the target > to > > > the > > > > simulator. > > > > > > > > I'm not sure if the cmake toolchain is set correctly. I'm using: > > > > > > > > set(CMAKE_SYSTEM_NAME Linux) > > > > set(CMAKE_SYSTEM_PROCESSOR sim) > > > > > > > > and set the compiler and tools to standard g++. > > > > > > > > Cheers, > > > > Nuno > > > > > > > > > > > > > > > > Em qui., 11 de nov. de 2021 às 20:42, Flavio Castro Alves Filho < > > > > flavio.al...@gmail.com> escreveu: > > > > > > > > > Hello Nuno, > > > > > > > > > > Before starting working with cmake, it is important that the C++ > > > > > configuration in nuttx is building and running. > > > > > > > > > > Did you get this part working? > > > > > > > > > > Best regards, > > > > > > > > > > Flavio > > > > > > > > > > Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos < > > > nunobarcel...@gmail.com > > > > > > > > > > > escreveu: > > > > > > > > > > > Hello! > > > > > > > > > > > > Could anyone get the C++ CMake HelloWorld example working for the > > > > > > simulator? > > > > > > I'm using the sim:libcxxtest config but am getting the following > > > error: > > > > > > > > > > > > nuttx-export/include/libcxx/cstdlib:154:9: error: > ‘::at_quick_exit’ > > > has > > > > > not > > > > > > been declared > > > > > > 154 | using ::at_quick_exit; > > > > > > > > > > > > Thanks, > > > > > > Nuno > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Nuno Bernardes Barcellos > > > > *Politecnico di Milano & University of São Paulo* > > > > M.Sc. in Electronics Engineering > > > > +5534988273589 <+393896649806> | nunobarcel...@gmail.com > > > > > > > > > > > > -- > > > Flavio de Castro Alves Filho > > > > > > flavio.al...@gmail.com > > > Twitter: http://twitter.com/#!/fraviofii > > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves > > > > -- > Flavio de Castro Alves Filho > > flavio.al...@gmail.com > Twitter: http://twitter.com/#!/fraviofii > LinkedIn profile: www.linkedin.com/in/flaviocastroalves >