Platform IO doesn't detect RAK 4631

I am trying to upload a code to read gas sensor values from the MQ2 sensor mounted on RAK Wisblock that has the RAK 4631 core module. However, platform io doesn’t detect the Board no matter how many times I connect it.

I tried to upload the code once and it seemed like it did work. However, after that the port cannot be seen and I am afraid that I have damaged the board by connecting it which shouldn’t have happened.

I am attaching my platform.ini and my main.cpp. The code compile fine but the upload port isn’t found.

platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
lib_deps =
rakwireless/RAKwireless MQx library@^1.0.0
adafruit/Adafruit TinyUSB Library@^3.1.5

main.cpp (truncated)
#include <Arduino.h>
#include <Adafruit_TinyUSB.h>
#include <Wire.h>
#include “ADC121C021.h”

#define EN_PIN WB_IO6 //Logic high enables the device. Logic low disables the device
#define ALERT_PIN WB_IO5 //a high indicates that the respective limit has been violated.
#define MQ2_ADDRESS 0x51 //the device i2c address
#define RatioMQ2CleanAir (1.0) //RS / R0 = 1.0 ppm
#define MQ2_RL (10.0) //the board RL = 10KΩ can adjust

The error message I get when I try to upload:
Looking for upload port…
Error: Please specify upload_port for environment or use global --upload-port option.
For some development platforms it can be a USB flash drive (i.e. /media//)
*** [upload] Explicit exit, status 1

Any help would be gladly appreciated.

The library needs lib_archive = no to work properly and activate the USB serial. If you’ve uploaded a sketch without it, you lost the serial port. You need to figure out how to boot the RAK4631 into bootloader mode to be able to flash it anew.