SIPEED MAIX/K210: Access Multi-Core CPU functions in Arduino?

Is there any information regarding the K210 multi-core feature and Arduino? Is this even supported?

suggestion:



2 Tabs in Arduino IDE



Main Tab: (Core0 code)
[code]#include <entry.h>

const uint8_t led = LED_RED;

void setup()
{
Serial.begin(9600);
Serial.print("Start Core: "); Serial.println(current_coreid());
pinMode(led,OUTPUT);
register_core1(main1 , NULL );
}

void loop()
{
const unsigned long interval = 333;
static uint64_t merker = 0;
static bool ledStatus = false;
if(millis() - merker > interval)
{
merker+=interval;
ledStatus = !ledStatus;
digitalWrite(led,ledStatus);
}
}[/code]



Second Tab: (Core1 code) [code] const uint8_t led1 = LED_BLUE;

void setup1()
{
Serial.print("Start Core: "); Serial.println(current_coreid());
pinMode(led1,OUTPUT);
}

void loop1()
{
const unsigned long interval = 1000;
static uint64_t merker = 0;

static bool ledStatus = false;
if(millis() - merker > interval)
{
merker+=interval;
ledStatus = !ledStatus;
digitalWrite(led1,ledStatus);
}
}

int main1(void *parameter)
{
setup1();
while(1)
{
loop1();
}
}[/code]

It is blinking with two led.





Be careful with concurrent access to resources.

Example: the serial outputs of both cores mix