diff --git a/APBUARTPLUGIN/uartpollingthread.cpp b/APBUARTPLUGIN/uartpollingthread.cpp
--- a/APBUARTPLUGIN/uartpollingthread.cpp
+++ b/APBUARTPLUGIN/uartpollingthread.cpp
@@ -55,14 +55,22 @@ void UARTPollingThread::run()
{
unsigned int status_reg,data;
char ch;
+ int cnt=0;
QString printdata="";
plugin->parent->Read(&status_reg,1,this->plugin->baseAddress()+APB_UART_STATUS_REG);
- while ((status_reg & 4)==0) {
+ while ((status_reg & 4)==0)
+ {
plugin->parent->Read(&data,1,this->plugin->baseAddress()+APB_UART_FIFO_DEBUG_REG);
ch = (char)(0xff & data);
printdata+=ch;
plugin->parent->Read(&status_reg,1,this->plugin->baseAddress()+APB_UART_STATUS_REG);
+ cnt++;
+ if(Q_UNLIKELY(cnt>100))
+ {
+ break;
+ }
}
+ timeout = 100;
if(printdata!="")
emit apbUartTextReceived(printdata);
}
@@ -99,6 +107,10 @@ void UARTPollingThread::run()
SocExplorerEngine::message(this->plugin,QString("Read %1 bytes on uart").arg(read),3);
ch[read]='\0';
}
+ else
+ {
+ timeout = 100;
+ }
}
uartMutex->unlock();
if(read>=1)
@@ -106,8 +118,8 @@ void UARTPollingThread::run()
SocExplorerEngine::message(this->plugin,QString("Received %1 char(s) from APBUART").arg(read),3);
emit this->apbUartTextReceived(QString(ch));
}
- msleep(timeout);
}
+ msleep(timeout);
}
}
diff --git a/ahbuartplugin/ahbuartplugin.cpp b/ahbuartplugin/ahbuartplugin.cpp
--- a/ahbuartplugin/ahbuartplugin.cpp
+++ b/ahbuartplugin/ahbuartplugin.cpp
@@ -236,7 +236,7 @@ unsigned int ahbuartplugin::Read(unsigne
timeout.start();
unsigned int read=0;
unsigned int cnt=count;
- unsigned int nextUpdateTrig=0,updateStep=512;
+ unsigned int nextUpdateTrig=0,updateStep=1024;
SocExplorerEngine::message(this,QString("Read ")+ QString::number(count) + QString(" words @0x")+ QString::number(address,16),2);
if((this->port!= badPortValue)||(this->port!=(rs232port_t)NULL))
{
@@ -342,7 +342,7 @@ unsigned int ahbuartplugin::Write(unsign
QTime timeout;
timeout.start();
unsigned int writen=0;
- unsigned int nextUpdateTrig=0,updateStep=512;
+ unsigned int nextUpdateTrig=0,updateStep=1024;
SocExplorerEngine::message(this,QString("Write ")+ QString::number(count) + QString(" words @0x")+ QString::number(address,16),2);
if((this->port!= badPortValue)||(this->port!=(rs232port_t)NULL))
{
diff --git a/ahbuartplugin/ahbuartpluginui.cpp b/ahbuartplugin/ahbuartpluginui.cpp
--- a/ahbuartplugin/ahbuartpluginui.cpp
+++ b/ahbuartplugin/ahbuartpluginui.cpp
@@ -28,15 +28,26 @@ ahbUartPluginUI::ahbUartPluginUI(QWidget
{
ui->setupUi(this);
connect(ui->OpenPort,SIGNAL(clicked()),this,SLOT(connectPort()));
- connect(ui->PortspeedSlider,SIGNAL(valueChanged(int)),ui->baurateLCD,SLOT(display(int)));
+// connect(ui->PortspeedSlider,SIGNAL(valueChanged(int)),ui->baurateLCD,SLOT(display(int)));
connect(ui->rescanPorts,SIGNAL(clicked()),this,SIGNAL(rescanPorts()));
+ QStringList allowedSpeeds;
+ allowedSpeeds<<"0"<<"50"<<"75"<<"110"<<"134"<<"150"<<
+ "200"<<"300"<<"600"<<"1200"<<"1800"<<"2400"<<
+ "4800"<<"9600"<<"19200"<<"38400"<<"57600"<<
+ "115200"<<"230400"<<"460800"<<"500000"<<"576000"<<
+ "921600"<<"1000000"<<"1152000"<<"1500000"<<"2000000"<<
+ "2500000"<<"3000000"<<"3500000"<<"4000000";
+
+ portSpeedCompleter = new QCompleter(allowedSpeeds);
+ this->ui->portSpeed->setCompleter(portSpeedCompleter);
this->writtenBytes = 0;
this->readBytes = 0;
}
void ahbUartPluginUI::connectPort()
{
- emit this->connectPortsig(ui->PortName->text(),ui->PortspeedSlider->value());
+ int baudrate = ui->portSpeed->text().toInt();
+ emit this->connectPortsig(ui->PortName->text(),baudrate);
}
void ahbUartPluginUI::setConnected(bool connected)
@@ -59,7 +70,7 @@ ahbUartPluginUI::~ahbUartPluginUI()
void ahbUartPluginUI::setconfig(QString PortName, int baudrate)
{
this->ui->PortName->setText(PortName);
- this->ui->PortspeedSlider->setValue(baudrate);
+ this->ui->portSpeed->setText(QString::number(baudrate));
}
void ahbUartPluginUI::addWritenBytes(int count)
diff --git a/ahbuartplugin/ahbuartpluginui.h b/ahbuartplugin/ahbuartpluginui.h
--- a/ahbuartplugin/ahbuartpluginui.h
+++ b/ahbuartplugin/ahbuartpluginui.h
@@ -58,6 +58,7 @@ private:
int writtenBytes;
int readBytes;
Ui::ahbUartPluginUI *ui;
+ QCompleter* portSpeedCompleter;
};
#endif // AHBUARTPLUGINUI_H
diff --git a/ahbuartplugin/ahbuartpluginui.ui b/ahbuartplugin/ahbuartpluginui.ui
--- a/ahbuartplugin/ahbuartpluginui.ui
+++ b/ahbuartplugin/ahbuartpluginui.ui
@@ -6,8 +6,8 @@
0
0
- 768
- 196
+ 884
+ 221
@@ -57,25 +57,6 @@
- -
-
-
- 3000000
-
-
- 9600
-
-
- 1
-
-
- 921600
-
-
- Qt::Horizontal
-
-
-
-
@@ -100,22 +81,6 @@
-
- -
-
-
-
- 75
- true
-
-
-
- 7
-
-
- QLCDNumber::Flat
-
-
-
-
@@ -136,6 +101,16 @@
+ -
+
+
+ 00000000
+
+
+ 115200
+
+
+
diff --git a/dsu3plugin/dsu3plugin.cpp b/dsu3plugin/dsu3plugin.cpp
--- a/dsu3plugin/dsu3plugin.cpp
+++ b/dsu3plugin/dsu3plugin.cpp
@@ -88,6 +88,7 @@ void dsu3plugin::openFile(QString fileNa
bool dsu3plugin::configureTarget()
{
+ int detectedMctrlr=-1;
if(parent==NULL)
return false;
unsigned int DSUBASEADDRESS = SocExplorerEngine::self()->getEnumDeviceBaseAddress(this,0x01 , 0x004,0);
@@ -100,6 +101,7 @@ bool dsu3plugin::configureTarget()
if(MCTRLBASEADDRESS != (unsigned int)-1)
{
SocExplorerEngine::message(this,QString("Found %1 @%2").arg(acceptedMemctrlr[i].name).arg(MCTRLBASEADDRESS,8,16),1);
+ detectedMctrlr=i;
break;
}
}
@@ -124,19 +126,27 @@ bool dsu3plugin::configureTarget()
WriteRegs(uIntlist()<<0,(unsigned int)DSUBASEADDRESS+0x000004C);
WriteRegs(uIntlist()<<0,(unsigned int)DSUBASEADDRESS+0x400040);
-
-
- WriteRegs(uIntlist()<<0x2FF<<0xE60<<0,(unsigned int)MCTRLBASEADDRESS);
+// {0x04,0x0f,"MCTRL"},
+// {0x01,0x51,"FTSRCTRL"},
+// {0x20,0x01,"SRCTRLE_0WS" },
+// {0x20,0x02,"SRCTRLE_1WS" }
+ if(QString(acceptedMemctrlr[detectedMctrlr].name)=="MCTRL" || QString(acceptedMemctrlr[detectedMctrlr].name)=="FTSRCTRL" )
+ {
+ WriteRegs(uIntlist()<<0x2FF<<0xE60<<0,(unsigned int)MCTRLBASEADDRESS);
+ }
+ if(QString(acceptedMemctrlr[detectedMctrlr].name)=="SRCTRLE_0WS" || QString(acceptedMemctrlr[detectedMctrlr].name)=="SRCTRLE_1WS" )
+ {
+ //let's perform a mem Wash
+ unsigned int val = ReadReg(MCTRLBASEADDRESS);
+ val |=1<<31;
+ WriteRegs(uIntlist()<Write(&buff,(unsigned int)1,DSUBASEADDRESS+0x300000+(4*i));
- // }
memSet(DSUBASEADDRESS+0x300000,0,1567);
WriteRegs(uIntlist()<<0<<0xF30000E0<<0x00000002<<0x40000000<<0x40000000<<0x40000004<<0x1000000,(unsigned int)DSUBASEADDRESS+0x400000);
WriteRegs(uIntlist()<<0<<0<<0<<0<<0<<0<<0x403ffff0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0<<0,(unsigned int)DSUBASEADDRESS+0x300020);