3 Troubleshooting

This chapter contains a list of common problems that you may encounter while installing and running the Oracle Java ME Embedded software on the ST Micro STM32429I-EVAL board. This chapter provides information on the causes of these problems and possible solutions for them.

The common problems in this chapter are grouped in four categories:

Installing the Firmware on the Board

Table 3-1 contains information about problems and solutions when installing the firmware on the board.


Table 3-1 Problems and Solutions - Installing the Firmware on the Board

Problem Cause Solution

The deploy.bat script fails and the firmware is not installed on the board.

The correct drivers are not installed into the MDK-ARM software for the board.

Ensure that the correct drivers for the board are downloaded in the MDK-ARM tool.

MDK-ARM states "The following Device Family Pack(s) are required by the project: Keil STM32F4xx_DFP:2.3.0"

The Device Pack drivers for the ST Micro board have not been downloaded and installed into MDK-ARM.

Use the Pack Installer tool in MDK-ARM to download and install the proper drivers. See Chapter 1 for more details.

Pop-up windows at the start of deployment occurs with message "Invalid ROM Table"

Problem with Keil MDK-ARM tool.

See http://www.keil.com/support/docs/3566.htm for more information.


Working with Oracle Java ME Embedded on the Board

Table 3-2 contains information about problems and solutions when starting the runtime on the board.


Table 3-2 Problems and Solutions - Starting Oracle Java ME Embedded on the Board

Problem Cause Solution

Oracle Java ME Embedded fails to start on the board, even after the firmware is installed correctly.

The SD card is not inserted correctly.

Eject the SD card from the board, insert it again and press the Reset button.

(continued)

The SD card is not formatted correctly using FAT32.

Format the SD card using the Windows format tool and copy the files from the Oracle Java ME Embedded distribution. See the section Setting Up the MicroSD Card in Installing on the ST Micro STM32429I-EVAL Board. Insert the SD card on the board and press the Reset button.

(continued)

Some files in the SD card are marked as read only.

Change the attributes of all files in the SD card and assign them write permissions. Insert the SD card on the board and press the Reset button.

(continued)

In rare cases, the file system of the SD card may be corrupted.

Re-format and re-install the contents of the SD card. See the section Setting Up the MicroSD Card in Installing on the ST Micro STM32429I-EVAL Board. Insert the SD card on the board and press the Reset button.

Oracle Java ME Embedded fails to properly set the clock on the board.

The jwc_prop.ini configuration file was not configured prior to board initialization.

Configure the date and time in the jwc_prop.ini file on the SD card and reset the board.

(continued)

The JP8 jumper on the board is set to VBAT, not 3V3

Set the jumper to 3V3.


Using the Board with the Oracle Java ME SDK and the NetBeans IDE

Table 3-3 contains information about problems and solutions when using the board with the Oracle Java ME SDK and the NetBeans IDE.


Table 3-3 Problems and Solutions - Oracle Java ME SDK and the NetBeans IDE

Problem Cause Solution

The Java ME menu does not appear; unable to find the Device Selector.

The Oracle Java ME SDK plugin for the IDE is not installed.

Install the Oracle Java ME SDK plugin that is specifically for your development IDE, as described in Installing and Running Applications on the STM32429I-EVAL Board.

The runtime on the board has problems accessing files or it is unstable.

The SD card is not supported or it is not formatted correctly.

Ensure that you are using a supported SD card and that you format it using the Windows formatting tool. See the section Setting Up the MicroSD Card in Installing on the ST Micro STM32429I-EVAL Board. Insert the SD card on the board and press the Reset button.

(continued)

Thunderbird is using a port that is needed for communication with the board.

Close thunderbird.exe during the debugging session.

An authorization failure is given when an IMlet attempts to install or access any Device Access API.

The IMlet is not signed.

Sign the IMlet using a keystore with a trusted certificate authority (CA), or run the IMlet in the untrusted security zone.

(continued)

The proper Device I/O API permissions have not been requested.

See Chapter 2 for information on how to add API permissions to a project.

(continued)

The date on the board may invalidate the certificate used to authenticate the digital signature.

See Installing on the ST Micro STM32429I-EVAL Board for the procedure on how to reset the RTC clock on the board.

Only four commands are available in the AMS CLI after connecting to the board.

The CLI proxy did not successfully connect to the board.

Ensure that an instance of the CLI proxy is not already running. Shut down any instances of the Oracle Java ME SDK Device Manager, which contains its own proxy and may already be using that port.

IMLet installation fails with a JAD_NOT_FOUND error

Firewall on a host which is sharing a JAD and JAR files is blocking an incoming HTTP or other requests.

Disable the firewall.

(continued)

Proxy issue.

Ensure proxy is disabled in Java Control panel and in Windows System Network settings


Opening the Development Log

The development log of the Oracle Java ME Embedded software can help you diagnose problems that arise when running IMlets on the board. The development log is covered in the section About Connecting to Logging Ports in Installing on the ST Micro STM32429I-EVAL Board.

  1. Connect a serial cable from the computer to the board. Use the CN8 connector.
  2. Ensure that the log.method property from the jwc_prop.ini file contains the value UART in its list.
  3. Open a terminal emulator on the computer, such as PuTTY.
  4. Choose a serial connection and set the following options:
    • Speed: 115200

    • Data bits: 8

    • Stop bits: 1

    • Parity: None

    • Flow control: XON/XOFF

    In PuTTY these options are in the category Connection > Serial.

  5. Open the connection. The system log appears on the terminal.

Output Stream Buffering

For optimization reasons, this implementation of the Oracle Java ME Embedded runtime does not provide OutputStreamWriter buffering. As such, the network layer on this platform does not provide OutputStream buffering for sockets. Consequently, any applications that are writing strings to a socket will have poor performance.

To solve this problem, you need to implement your own OutputStream with an additional ByteArrayOutputStream, as shown in the following example:

Writer writer = new OutputStreamWriter(new BufferedOutputStream(client.openOutputStream()));  
writer.append("HTTP/1.0 200 OK").append('\n');
...// more
writer.close();

class BufferedOutputStream extends OutputStream {  
   final OutputStream os;  
   final ByteArrayOutputStream baos;  
   final int size;  
   final static int DEFAULT_BUFFER_SIZE = 256;  
      
   public BufferedOutputStream(OutputStream os) {  
      this(os, DEFAULT_BUFFER_SIZE);  
   }  
      
   public BufferedOutputStream(OutputStream os, int size) {  
      this.os = os;  
      this.baos = new ByteArrayOutputStream(size);  
      this.size = size;  
   }  
      
   public void write(int b) throws IOException {  
      if (baos.size() >= size) {  
         // buffer full, avoid creating new array --> flush to free  
         flush();  
        }  
        baos.write(b);  
      }  
      
   public void flush() throws IOException {  
      if (baos.size() > 0) {  
         baos.writeTo(os);  
         baos.reset();  
      }  
   }  
      
   public void close() throws IOException {  
      this.flush();  
      os.close();  
   }  
     
}