Coder Social home page Coder Social logo

Comments (12)

DansDesigns avatar DansDesigns commented on June 6, 2024

I couldn't find a solution to the pins_arduino issue so I modified the example ones for the STM32, I am not sure if they work yet as
I still have issues with 'class' not being recognized in SPI.h, Wire.h, Print.h, Printable.h and Stream.h...

I have attached them to this post so maybe someone else can verify if they work?
pins_arduino.zip

from rtduino.

DansDesigns avatar DansDesigns commented on June 6, 2024

Somehow the 'class' error has fixed itself but now the modified pins_arduino.c is giving the following error:
../packages/RTduino-latest/core/pins_arduino.c:25:10: error: initializer element is not constant
this is referencing the first line where D0 is defined but the error applies to all lines..
I did not change the structure of the file just the pins.. here is the contents of the modified pins_arduino.c:

/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-09-20     liYony       first version
 * 19/10/2023     Daniel Miles  updated for RA6M3
 *
 */

#include <Arduino.h>
#include "pins_arduino.h"

/*
 * {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
 * [] means optional
 * Digital pins must NOT give the device name and channel.
 * Analog pins MUST give the device name and channel(ADC, PWM or DAC).
 * Arduino Pin must keep in sequence.
 */
const pin_map_t pin_map_table[]=
{
    {D0, GET_PIN(P206), "uart1"},      /* Serial-Rx */
    {D1, GET_PIN(P205), "uart1"},       /* Serial-Tx */
    {D2, GET_PIN(P008)},
    {D3, GET_PIN(P506)},
    {D4, GET_PIN(P603), "pwm1", 1},      /* PWM */
    {D5, GET_PIN(P604), "pwm1", 2},     /* PWM */
    {D6, GET_PIN(P605), "pwm1", 3},     /* PWM */
    {D7, GET_PIN(P208)},
    {D8, GET_PIN(P207)},                /* LED_BUILTIN */
    {D9, GET_PIN(P009), "adc1", 5},      /* ADC */
    {D10, GET_PIN(P712), "pwm1", 4},     /* PWM */
    {D11, GET_PIN(P512), "spi1"},       /* SPI-MOSI */
    {D12, GET_PIN(P511), "spi1"},       /* SPI-MISO */
    {D13, GET_PIN(P204),  "spi1"},       /* SPI-SCK */
    {D14, GET_PIN(P203), "i2c1"},        /* I2C-SDA (Wire) */
    {D15, GET_PIN(P202), "i2c1"},        /* I2C-SCL (Wire) */
    {D16, GET_PIN(P209), "led_user1"},       /* user LED 1 */
    {D17, GET_PIN(P210), "led_user2"},       /* user LED 2 */
    {D18, GET_PIN(P005), "btn_user0"},       /* user button 0 */
    {D19, GET_PIN(P006), "btn_user1"},       /* user button 1 */
    {D20, GET_PIN(P007), "btn_user2"},       /* user button 2 */
    {A0, GET_PIN(P00), "adc1", 1},      /* ADC */
    {A1, GET_PIN(P001), "adc1", 2},      /* ADC */
    {A2, GET_PIN(P002), "adc1", 3},      /* ADC */
    {A3, GET_PIN(P003), "adc1", 4},      /* ADC */
    {A4, GET_PIN(P508)},
    {A5, GET_PIN(P014), "adc1", 6},      /* ADC */
    //{A6, RT_NULL, "adc1", RT_ADC_INTERN_CH_VREF},   /* ADC, On-Chip: internal reference voltage */
};

from rtduino.

DansDesigns avatar DansDesigns commented on June 6, 2024

Any help with this would be greatly appreciated..
This was part of my entry into the RT-Thread Embedded GUI Contest 2023 but I am unable to complete the project due to this error.

from rtduino.

kurisaW avatar kurisaW commented on June 6, 2024

@DansDesigns Hello, currently HMI-Board supports RTduino, you can go to RT-Thread cloning project.Please go to this link to view the RTduino usage documentation and close this issue

from rtduino.

DansDesigns avatar DansDesigns commented on June 6, 2024

Hi kurisaW,

Thank you for your response.
I followed the link you provided but all it gave me was this error:

404 - page not found
The 
master

 branch of 
rt-thread

 does not contain the path 
bsp/renesas/ra6m3-hmi-board/board/rtduino/arduino_pinout/README.md.

The board folder does not contain a folder called rtduino??

I have been able to translate the Chinese Readme into English but it does not have any useful information about how to troubleshoot RTduino or the issue present in this and issue#79..

EDIT:
I started again and made a new RT-Thread Project, using the hmi-board-factory example.
enabled RTduino and the SPI and WIRE libraries, changed rw007 and lvgl version to "latest", saved the changes in RT-Thread Settings, rebuilt the project, updated packages, click build and the same errors appear..

from rtduino.

kurisaW avatar kurisaW commented on June 6, 2024

@DansDesigns Since yesterday's pr has not been merged, now you can check the specific use process through the above link, and please feedback to us if you have any questions in the future.

from rtduino.

mysterywolf avatar mysterywolf commented on June 6, 2024

Hi, sorry for the late respond. I am too busy, I have merged the PR, please check again.

from rtduino.

DansDesigns avatar DansDesigns commented on June 6, 2024

Hi @mysterywolf & @kurisaW, thank you for your replies,

I checked that link again and the readme is now present..
however when starting a new project (or updating an existing one) the errors still persist,
should i manually put the "pins_arduino" files into the correct folders??

Please see attached image for more info

Also i noticed that the I2C1 SCL and SDA are not referenced in the pins_arduino.c however they are already defined in rtconfig.. my hardware is already made to match those pins for I2C1.. is I2C1 usable in rtduino?

rt-thread_rtduino_error

EDIT:
So i manually copied the contents of pins_arduino.c and pins_arduino.h from the readme linked above and the errors are reduced to just one:

arm-none-eabi-gcc "../board/ra6m3_it.c"
linking...
c:/rt-threadstudio/repo/extract/toolchain_support_packages/arm/gnu_tools_for_arm_embedded_processors/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot open linker script file memory_regions.ld: No such file or directory
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:188: rtthread.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

I have run updates on all the required bits in the SDK Manager, I have even completely removed and reinstalled RT-Thread Studio but the error still remains. In SDK Manager i have the latest version of 10.2.1 of the gnu_tools_for_arm_embedded_processors??

from rtduino.

kurisaW avatar kurisaW commented on June 6, 2024

@DansDesigns In fact, you shouldn't select RTduino in the package, please clear all Rtduino-related configuration, and follow my next steps to enable RTduino:

  1. Open RT-Thread studio settings
  2. Select 'Hardware' from the Status bar
    3.Onboard Peripheral Drivers
    -->Compatible with Arduino Ecosystem (RTduino) (Enable this option)
  3. Press ctrl+s to save the configuration, download the software package, and compile it

image

image

After the program is burned, open the msh terminal and use the 'list device' command, you should see that the following devices are registered and the RTduino thread's log information is automatically printed when activated

image

from rtduino.

DansDesigns avatar DansDesigns commented on June 6, 2024

hi @kurisaW,

Thank you for the great tutorial,
It would seem we are using something different as I have no option for "Onboard Peripheral Drivers"...
rt-thread_rtduino-hardware-issue

to be honest I am at the end of my rope. I have been struggling with this for over 2 months!
I am going to throw the board away as it is SO stressful getting a simple arduino layer working..
The difficulty i have had with this board has really put me off working on my own projects and I feel like never touching rtthread again..

Thank you for all your help, I hope other are able to get this working.
kind regards

from rtduino.

kurisaW avatar kurisaW commented on June 6, 2024

@DansDesigns A few points need to be made clear to you again:

  1. Please download the latest source code of the RT-Thread repository:
  1. It is recommended that you use RT-Thread's env tool:

Env to use at the same time please refer to the document center tutorial:

Here are some common commands for env:

scons-j8 // 8 core compiled source code
scons-c // Clear the build
scons --menuconfig // Opens the menu configuration interface, equivalent to settings in Studio
pkgs --update // Update and download the software package
  1. Directly go to the HMI-Board bsp directory for compilation, or import it to studio

Additional note: For developers, the use of RT-Thread is relatively easy to get started, but the new white need to learn more and draw on the development process of RT-Thread, once you are familiar with the development, I believe you will understand the convenience of RT-Thread


To answer your question above: "I have no option for "Onboard Peripheral Drivers"

This is because the adaptation PR of RTduino was merged yesterday, and you need to synchronize the master branch with git locally. You can refer to my above instructions again for the use configuration after that. If you have any other questions, please contact me!

from rtduino.

mysterywolf avatar mysterywolf commented on June 6, 2024

please try use env+vscode

from rtduino.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.