Pins HIGH at startup

When I start my Sakura board (with program), sometimes the pins are high right when power is applied, and sometimes the pins stay low until the initialization of the program is actually done. 

As I am using the pins to turn on relays, that control movement, it is important that the pins controlling the relays remain low until the initialization is done and I set them high manually.

Is it possible to ensure such behaviour? The older Sakura (128K RAM) did not have the same problem.



  • Hi Mitsuki,

    Can you share your code here? So that the forum can examine if there's something in the code that's enabling the port before the initialization. Thanks!

    RenesasRulz Forum Moderator
  • Dear JB,

    The application is programmed in Renesas Web Compiler. I am not sure what is programmed in the libraries that are provided there. I was mistaken in my previous post, both the Sakura devices I have here are the 256k RAM models.
    Is there anything I can change in the libraries provided in the default Sakura Sketch 2.20?

  • Dear Mitsuki,

    I'm sorry not to prepare a project template for 256KB RAM. I will prepare later.
    The below is how to modify RAM size and start up code.

    1. Remove "gr_common.a" in gr_common folder
    2. Open "linker_arduino.gsi"
    3. Modify memory size and location as below.

    RAM : ORIGIN = 0x0, LENGTH = 262144
    ROM : ORIGIN = 0xFFF00000, LENGTH = 1048576

    .istack 0x40000 : AT (0x40000)
    _istack = .;
    .ustack 0x3FF00 : AT (0x3FF00)
    _ustack = .;
    } > RAM

    4. If you want to modify the start up code until setup(),
    please see "wiring.c in gr_common/core" folder and "hardware_setup.cpp in gr_common/rx63n" folder
    5. After modification, execute build it.
  • Dear Okamiya Yuuki,

    Thanks for the reply, the files you point at are indeed useful to us.

    Will you also update the start project for e2 studio, to use the 256k version? Or is this an easy change that I can do myself?

  • Yes, you can. Modify "linker_arduino.gsi" as I mentioned above. That's all for 256k.
  • Dear Okamiya Yuuki,

    I have tried editing the linker_arduino.gsi as you mentioned above. The settings are ignored.

    I then looked in the project properties, and found in C/C++ Build->Settings->[Tool settings]-> Linker->Sections the sections as e2 studio uses them. However, this is one of the few tabs I cannot edit anything in. Could you explain why this is? Below I have added a screenshot of the configuration screen.