Zephyr Portenta C33 - update 0.90.0

Not sure if it is just me, but as I was having issues building the current
Zephyr sources for C33 (resolved - needed to do a clean boootstrap),

I thought I would program my C33, which I have not used in a while.

Note: In this case was programming it using todays released Zephyr install.

Like the H77 and UnoQ I was playing with, I first double clicked on
boot button, to put into bootloader mode and tried to program it.

It properly detected that the "Bootloader" version was not the same as the one associated with the current release, so it automatically burned the bootloader (new feature of this release), It then continued on to try to upload the compiled program, which hung at 70 something percent (think 72%).

Tried it again, same result, third time Same.

Tried to upload example Blink, same thing.

With blink, I double clicked, choose a programmer (Jlink), did the manual burn the bootloader, which completed, then saw fast double blink of blue LED.

So again I double clicked on boot button, uploaded blink, this time I believe it again went through the program the bootloader, and then successfully uploaded the blink program :smiley: I choose the new Serial port number for the C33 and it properly uploaded the original sketch.

Not that I think it matters, but the sketch was a simple pin test to which pin I click on... Stripped version of another version which printed pin names on H77.

uint8_t pin_test_mode = 1;


// manually disabled 16-19/27-28
// 23-25 as LEDS
uint8_t pinLast[NUM_OF_DIGITAL_PINS] = {0};


bool pins_changed[NUM_OF_DIGITAL_PINS];

extern void allPinTest();

void setup() {
  Serial.begin(115200);
  while (!Serial && millis() < 10000)
    ;
  //Serial.println("Compile Time:: " __FILE__ " " __DATE__ " " __TIME__);
  Serial.print("NUM_OF_DIGITAL_PINS: ");
  Serial.println(NUM_OF_DIGITAL_PINS, DEC);
  Serial.println("Pins included in test:");

}

void loop() {
  allPinTest();
}


void allPinTest() {
  uint32_t ii;
  for(ii=0; ii < NUM_OF_DIGITAL_PINS; ii++) pins_changed[ii] = false;

  Serial.print("PULLUP Start Vals:\n  ");
  Serial.print("PULLUP :: TEST to GND\n  ");
  for (ii = 0; ii < NUM_OF_DIGITAL_PINS; ii++) {
    if (pinLast[ii] != 0xff) {
      if ((ii == 0) || (pinLast[ii - 1] == 0xff)) {
        Serial.print("\n(");
        Serial.print(ii);
        Serial.print(") ");
        Serial.flush();
      }
      pinMode(ii, INPUT_PULLUP);
      delayMicroseconds(5);
      pinLast[ii] = digitalRead(ii);
      if (!pinLast[ii]) {
        Serial.print("\nd#=");
        Serial.print(ii);
        Serial.print(" val=");
      }
      Serial.print(pinLast[ii]);
      Serial.print(',');
    }
  }
  Serial.println();
  Serial.println();
  while (1) {
    uint32_t jj, dd = 0, cc = 0, ee = 4;
    cc = 0;
    for (ii = 0; ii < NUM_OF_DIGITAL_PINS; ii++) {
      if (pinLast[ii] != 0xff) {
        jj = digitalRead(ii);
        if (jj != pinLast[ii]) {
          pins_changed[ii] = true;
          dd = 1;
          cc++;
          pinLast[ii] = jj;
          Serial.print("d#=");
          Serial.print(ii);
          Serial.print(" val=");
          Serial.print(pinLast[ii]);
          Serial.print(',');
          //if (cc > 1 && ee) {
          //  Serial.println(">>> MULTI CHANGE !!");
          //  ee--;
          //}
        }
      }
    }
    if (dd) {
      dd = 0;
      Serial.println();
      delay(50);
    }

    if (Serial.available()) {
      while (Serial.available()) Serial.read();
    
      Serial.println("Pins that were touched: ");
      bool changed_found = false;
      for(ii=0; ii < NUM_OF_DIGITAL_PINS; ii++) {
        if (pins_changed[ii]) {
          pins_changed[ii] = false;
          if (!changed_found) {
            changed_found = true;
            Serial.print(" ");
            Serial.print(ii);
          }
        } else if (changed_found) {
          Serial.print("-");
          Serial.print(ii-1);
          changed_found = false;
        }
      }
      if (changed_found) {
        Serial.print("-");
        Serial.print(-1);
        changed_found = false;
      }
      Serial.println();

      if (0 == pin_test_mode) {
        pin_test_mode = 1;
        Serial.print("PULLUP :: TEST TO GND\n  ");
      } else {
        pin_test_mode = 0;
        Serial.print("PULLDOWN :: TEST to 3.3V\n  ");
      }
      for (ii = 0; ii < NUM_OF_DIGITAL_PINS; ii++) {
        if (pinLast[ii] != 0xff) {
          if (0 == pin_test_mode)
            pinMode(ii, INPUT_PULLDOWN);
          else
            pinMode(ii, INPUT_PULLUP);
          delayMicroseconds(20);
          pinLast[ii] = digitalRead(ii);
          if (pin_test_mode != pinLast[ii]) {
            Serial.print("d#=");
            Serial.print(ii);
            Serial.print(" val=");
            Serial.println(pinLast[ii]);
          }
        }
      }
    }
  }
}

Not sure if this was a fluke with my board, or is repeatable...