Sunday, December 19, 2021

Tuesday, November 30, 2021

LS1043A Challenges

Timer interrupt: Timer Running, But timer interrupt does not occur
The GIC-400 Interrupt controller has allocation of priority bits for secure and non-secure modes. It needs to be set in Secure monitor mode. By default, non-secure mode had zero bits. Once I allocated maximum bits for non-secure mode, interrupt started coming.

UART and Clock control registers not visible in non-secure mode
By default the clock is enabled for UART. So, clock was not an issue. But, the module needs to be enabled to read/write in secure/non-secure modes. This was default enabled in secure mode, but not for non-secure. So, once enabled the bits, it was visible to the program.

LAN driver

References:

Layerscape Software Development Kit User Guide

NXP Dual Chip Module Automotive Gateway

Patch

U-Boot drivers

An Introduction to the QorIQ Data Path Acceleration Architecture (DPAA)

Linux kernel text

FMAN microcode

Actual Driver source for Independent mode is here:

The uploading of FMAN microcode is here:

LSDK Open Source Git

Layerscape Software Development Kit User Guide

Aarch64 Online Assembler


Monday, June 21, 2021

Autosys: Reporting

 Installer Downloads

1) Download Apache tomcat 9.0.48 Service Installer in the page.

   https://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.48/bin/apache-tomcat-9.0.48.exe

2) Download JDK from JAVA SE downloads. JDK 16.0.1

   https://download.oracle.com/otn-pub/java/jdk/16.0.1+9/7147401fd7354114ac51ef3e1328291f/jdk-16.0.1_windows-x64_bin.exe

3) Download mysql msi community installer.  (No need for login)

   https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.25.0.msi


Installation order

1) Install JDK first as default Path

2) Test installation by javac command in command prompt.

3) Install Service Installer.

   Select Full.

   It should detect JDK path automatically.

   Next Specify your own (C:/Autosys) Tomcat Install Path.

4) Now, copy the webapps\AUTOBATCHING

5) Test http://localhost:8080/AUTOBATCHING should work now.

6) Needs to install mysql.

   (It needs manual installation of Visual studio 2019. Only for Win apps??)

   Create only root with sa123 password.

7) Copy C:\Program Files (x86)\MySQL\Connector J 8.0\mysql-connector-java-8.0.25.jar to C:\Autosys\Tomcat9\lib

8) Now, if you create database autobatch, it should ask for the table in the webpage.

9) execute command source autobatchdb.sql.


Compilation:

C:\myAnalysis\Tomcat 9.0\webapps\AUTOBATCHING\WEB-INF\classes\Autobatch\Master\RecipeDownload>javac -cp .;"C:\myAnalysis\Tomcat 9.0\lib\servlet-api.jar";"C:\myAnalysis\Tomcat 9.0\webapps\AUTOBATCHING\WEB-INF\lib\EasyModbusJava.jar";"C:\myAnalysis\Tomcat 9.0\webapps\AUTOBATCHING\WEB-INF\classes" DownloadRecipe.java

I kept the source in the same directory where the class file existed, changed to that directory in the command prompt and built from that directory.

Database Creation

create database if not exists autobatch;
http://www.javadecompilers.com/result

show databases;


mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';
mysql> FLUSH PRIVILEGES;
mysql> quit

copied mysql-connector-java-8.0.24.jar to C:\myAnalysis\Tomcat 9.0\lib.

SHOW TABLES;


mysql> describe tbl_materialmaster;

CREATE TABLE tbl_materialmaster (Pkey INT AUTO_INCREMENT, MaterialCode INT, MaterialName Varchar(64), LogTime DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (Pkey))

5 tables;
=========

CREATE TABLE `tbl_materialloc` (
`Pkey`         INT NOT NULL AUTO_INCREMENT,
`SiloNum`      INT NOT NULL,
`MaterialCode` Varchar(45),
`MaterialName` Varchar(45),
`MaterialDesc` Varchar(145),
`Active`       BIT(1) DEFAULT 1,
`LogTime`      DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Pkey`));

describe `tbl_materialloc`;
drop table `tbl_materialloc`;
------

CREATE TABLE `tbl_materialmaster` (
`Pkey`         INT NOT NULL AUTO_INCREMENT,
`MaterialCode` INT NOT NULL,
`MaterialName` Varchar(45) NOT NULL,
`MaterialDesc` Varchar(145),
`Active`       BIT(1) DEFAULT 1,
`UnitPrice`    FLOAT,
`LogTime`      DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Pkey`));

describe `tbl_materialmaster`;
drop table `tbl_materialmaster`;
------

CREATE TABLE `tbl_recipedownload` (
`Pkey`         INT NOT NULL AUTO_INCREMENT,
`SiloNum`      INT NOT NULL,
`MaterialKey`  Varchar(45) NOT NULL,
`MaterialCode` Varchar(45) NOT NULL,
`MaterialName` Varchar(45) NOT NULL,
`SetWt`        FLOAT,
`FineWt`       FLOAT,
`InflightWt`   FLOAT,
`TollarenceWt` FLOAT,
`Active`       BIT(1) DEFAULT 1,
`LogTime`      DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Pkey`));

describe `tbl_recipedownload`;
drop table `tbl_materialmaster`;
------

CREATE TABLE `tbl_recipemaster` (
`Pkey`         INT NOT NULL AUTO_INCREMENT,
`SiloNum`      INT DEFAULT 0,
`RecipeCode`   INT,
`RecipeName`   Varchar(45),
`MaterialKey`  Varchar(45),
`MaterialCode` Varchar(45),
`MaterialName` Varchar(45),
`SetWt`        FLOAT,
`FineWt`       FLOAT,
`InflightWt`   FLOAT,
`TollarenceWt` FLOAT,
`Active`       BIT(1) DEFAULT 1,
`LogTime`      DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Pkey`));

describe `tbl_recipemaster`;
drop table `tbl_recipemaster`;
------

CREATE TABLE `tbl_reportmaster` (
`Pkey`         INT NOT NULL AUTO_INCREMENT,
`BatchID`      Varchar(45),
`LotNo`        INT,
`lngBatchDate` INT,
`lngBatchTime` INT,
`RecipeCode`   Varchar(45),
`RecipeName`   Varchar(45),
`WHNum`        INT,
`SiloNum`      INT,
`MaterialKey`  Varchar(45),
`MaterialCode` Varchar(45),
`MaterialName` Varchar(45),
`SetWt`        FLOAT,
`FineWt`       FLOAT,
`InflightWt`   FLOAT,
`TolrWt`       FLOAT,
`ActualWt`     FLOAT,
`Active`       BIT(1) DEFAULT 1,
`LogTime`      TIME,
`LogDate`      DATE,
`LogDateTime`  DATETIME,
`SysDateTime`  DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Pkey`));

describe `tbl_reportmaster`;
drop table `tbl_reportmaster`;
---

Creating 8 Silos;

INSERT INTO tbl_materialloc (SiloNum) VALUES (1);
INSERT INTO tbl_materialloc (SiloNum) VALUES (2);
:
INSERT INTO tbl_materialloc (SiloNum) VALUES (8);

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Howto Get a Database


-- Start a NEW "cmd"
c:
cd \myWebProject\mysql\bin
mysqldump -u myuser -p --databases studentdb > "c:\myWebProject\backup_studentdb.sql"

----
c:
cd \myWebProject\mysql\bin
mysql -u myuser -p
-- Run the backup script to recreate the database
mysql> drop database if exists studentdb;
mysql> source c:\myWebProject\backup_studentdb.sql
F

Monday, May 31, 2021

wolfMQTT

1) download or clone from git.

2) ./configure --disable-tls --disable-examples

3) make

----

./configure --help



Tuesday, May 4, 2021

Java Tomcat JSP Servlets Database

 https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaWebDBApp.html

https://www.akadia.com/download/soug/tomcat/html/tomcat_apache.html


            final String userName = "root";
            final String password = "sa123";

cd \myWebProject\mysql\bin

mysql -u root -p

SHOW DATABASES;
use autobatch;
SHOW TABLES;



Tuesday, March 23, 2021

Windows TCP Client Program

 Open Visual Studio and create new C++ console application.

Copy and the following program and build.

https://docs.microsoft.com/en-us/windows/win32/winsock/complete-client-code