Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with a new board #325

Closed
VEGA-Processor opened this issue Oct 5, 2023 · 2 comments
Closed

Issue with a new board #325

VEGA-Processor opened this issue Oct 5, 2023 · 2 comments
Assignees
Labels
type: support OT: Request for help using the project

Comments

@VEGA-Processor
Copy link

Hello everyone,
I am using the new development board called ARIES IoT. This board is built upon a RISC-V ISA compliant VEGA Processor. I did the necessary changes in BLELocalDevice::begin() function to initialise all the pins. I am trying peripheral/LED example to control a built-in LED with nRF Connect app.
It is working when I put some print messages before HCITransport.write() function call in HCIClass::sendCommand() function. I tried to replace the print statements with delay but it is not working that way.

int HCIClass::sendCommand(uint16_t opcode, uint8_t plen, void* parameters)
{
  struct __attribute__ ((packed)) {
    uint8_t pktType;
    uint16_t opcode;
    uint8_t plen;
  } pktHdr = {HCI_COMMAND_PKT, opcode, plen};

  uint8_t txBuffer[sizeof(pktHdr) + plen];
  memcpy(txBuffer, &pktHdr, sizeof(pktHdr));
  memcpy(&txBuffer[sizeof(pktHdr)], parameters, plen);

  if (_debug) {
    dumpPkt("HCI COMMAND TX -> ", sizeof(pktHdr) + plen, txBuffer);
  }
#ifdef _BLE_TRACE_
  Serial.print("Command tx -> ");
  for(int i=0; i< sizeof(pktHdr) + plen;i++){
    Serial.print(" 0x");
    Serial.print(txBuffer[i],HEX);
    
  }
  Serial.println("");
#endif
  Serial.println(__LINE__);
  Serial.println(__LINE__);
  Serial.println(__LINE__);
  Serial.println(__LINE__);
  // delayMicroseconds(1389);
  // Serial.println();
  delay(1);

  HCITransport.write(txBuffer, sizeof(pktHdr) + plen);

  _cmdCompleteOpcode = 0xffff;
  _cmdCompleteStatus = -1;

  for (unsigned long start = millis(); _cmdCompleteOpcode != opcode && millis() < (start + 1000);) {
    poll();
  }

  return _cmdCompleteStatus;
}

I am using the latest ArduinoBLE library.

I added following lines in begin():

  pinMode(SPIWIFI_SS, OUTPUT);
  pinMode(NINA_RESETN, OUTPUT);
  
  digitalWrite(SPIWIFI_SS, LOW);

  digitalWrite(NINA_RESETN, LOW);
  delay(100);
  digitalWrite(NINA_RESETN, HIGH);
  delay(750);

// set SS HIGH
  digitalWrite(SPIWIFI_SS, HIGH);

  // set RTS HIGH
  pinMode(NINA_RTS, OUTPUT);
  digitalWrite(NINA_RTS, HIGH);

  // set CTS as input
  pinMode(NINA_CTS, INPUT);

Baudrate is 115200

@per1234 per1234 self-assigned this Oct 5, 2023
@per1234 per1234 added the type: support OT: Request for help using the project label Oct 5, 2023
@per1234
Copy link
Contributor

per1234 commented Oct 5, 2023

Hi @VEGA-Processor. Thanks for your interest in this open source project. This issue tracker is only to be used to report bugs or feature requests specific to the project. This topic is more appropriate for the Arduino Forum. I'm sure we will be able to help you out over there:

https://forum.arduino.cc/

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@VEGA-Processor
Copy link
Author

OK, thank you @per1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support OT: Request for help using the project
Projects
None yet
Development

No branches or pull requests

2 participants