Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jackking

Pages: 1 [2] 3
16
I tried recreating the DCD data using the values from NXP, but this didn't really help.   I still get the same result. 

I will try next to use the NXP iMXRT1052 EVK, also try setting up the SEMC in the application directly vs relying on the DCD, but this will take some time to set up.

@mark.  Do you have a project that is validated to work with the SDRAM on i.MX RT?    I am just building the project with very few modifications and it isn't working.

Thanks
JK


17
I cloned a new checkout from the V2.0.0 branch, and built from scratch, with the only change to add the SDRAM test routine shown above and remove the #define for REV_C and add the define for SDRAM support. 

It still crashes after writing 32 bytes.

This is building for iMX_RT1062_EMB_ART,  Rev B, not Rev C, so I have commented out the define for Rev C:
Code: [Select]
//#define iMX_RT10XX_EMB_ART_REV_C
#define BOOT_LOADER_SUPPORTS_SDRAM

Building in MCUXpresso 11.4.1_6260 so I don't need to modify the linker scripts.

Here is the test output:
Code: [Select]
uTasker Serial Loader V2.4                                                     
===========================                                                     
[0x60020100/0x6009ffff]                                                         
bc = blank check                                                               
dc = delete code                                                               
ld = start load                                                                 
bt = start boot loader                                                         
go = start application                                                         
> Enumerated                                                                   
rd                                                                             
Write SDRAM: .................................   

After writing  those bytes the application crashes and the watchdog resets.

I'm not sure where to go from here. 

Thanks
JK

18
OK, I have rolled my code back as far as possible to the latest V2.0.0 master commit and I still get the same behaviour with SDRAM.  I am going to try on my Embedded Artists dev kit next.

Thanks
JK

19
OK, that is similar to what I tried, without success. 

I set the following in config.h of uTaskerBoot:
Code: [Select]
#define BOOT_LOADER_SUPPORTS_SDRAM
I set the following in app_hw_iMX.h of uTaskerSerialBoot:

Code: [Select]
    #define SDRAM_SIZE          (32 * 1024 * 1024)                       // 32MByte
    #define BOOT_LOADER_SUPPORTS_SDRAM
    #define SDRAM_START_ADDRESS     0x80000000
    #define DISABLE_SDRAM_CACHE
    #define SEMC_AVAILABLE

and added your routine as a menu item under "rd" for RAM DUMP:
Code: [Select]
else if ((ucSerialDebugInputMessage[0] == 'r')
|| (ucSerialDebugInputMessage[0] == 'R')) {
if ((ucSerialDebugInputMessage[1] == 'd')
|| (ucSerialDebugInputMessage[1] == 'D')) {

fnDebugMsg("\r\nWrite SDRAM: ");
unsigned char *ptrSDRAM = (unsigned char *)SDRAM_ADDR;
unsigned long ulTestCnt = (4 * 1024 * 1024);
unsigned char ucByte = 0;
while (ulTestCnt--  != 0) {
    *ptrSDRAM++ = ucByte++;
}

fnDebugMsg("\r\nDump SDRAM: ");
ptrSDRAM = (unsigned char *)SDRAM_ADDR;
ulTestCnt = (4 * 1024 * 1024);
while (ulTestCnt--  != 0) {
    fnDebugHex((unsigned char) *ptrSDRAM++, (sizeof(unsigned char)));
}

break;
}
}

Which instantly crashes when trying to write past 0x20 bytes.  It also crashes immediately on the read back of the first byte, if I write less than 0x20 bytes.

20
NXPTM M522XX, KINETIS and i.MX RT / Serial Loader: Placing vars into SDRAM?
« on: February 05, 2024, 04:01:48 PM »
I am trying to figure out how to place a file buffer into i.MX RT SDRAM in the Serial Loader application.   I am receiving my (binary, not SREC) update file via slow UART and would like to capture the entire file into a buffer (4MB) before erasing and then flashing XiP memory.

Is there an example of placing a specific var into SDRAM memory?

Thanks
JK

21
Mark,

Thanks for that.  I was able to test it.  I think there is still some issue with the interrupt handler, I had to remove the SDHC_DETECT_INTERRUPT_GPIO exclusion in kinetis_SDHC.h before the card would move beyond the idle command.  After removing this, I was able to get the card mounted.

line 193 - before removing the exclusion:

Code: [Select]
#if (defined SDCARD_DETECT_INPUT_INTERRUPT && !defined SDHC_DETECT_INTERRUPT_GPIO)
    sdcard_handler[0] = int_handler;
        #if (defined _iMX && defined USE_uSDHC2)
    fnEnterInterrupt(irq_USDHC2_ID, SDCARD1_STATUS_INTERRUPT_PRIORITY, sdcard_state_change);
    SDHC2_IRQSIGEN = (SDHC_IRQSIGEN_CRMIEN | SDHC_IRQSIGEN_CINSIEN);     // enable interrupts on card insertion and removal
    SDHC2_IRQSTATEN = 0xffffffff;                                        // allow all enabled interrupts
        #else
    fnEnterInterrupt(irq_USDHC1_ID, SDCARD1_STATUS_INTERRUPT_PRIORITY, sdcard_state_change);
    SDHC_IRQSIGEN = (SDHC_IRQSIGEN_CRMIEN | SDHC_IRQSIGEN_CINSIEN);      // enable interrupts on card insertion and removal
    SDHC_IRQSTATEN = 0xffffffff;                                         // allow all enabled interrupts
        #endif
#endif

22
Is there a section in the config file to set alternate pins for these SDCARD functions?

I didn't see any way to select an arbitrary GPIO pin for card detect (as can be done in the MCUXpresso SDK).  I did manually change the PWREN pin, and I haven't found the VSELECT pin setting yet.

JK

23
Mark, thanks for the quick reply.  Thanks for confirming that the fixed OCRAM was not meant to be represented in the header.


24
In the guide (page 21): https://www.utasker.com/docs/iMX/MCUXpresso.pdf

It states that FlexRAM can be preconfigured for the application:

Quote
In comparison, this one has the desired FlexRAM configuration:
02f8 // first two bytes specify the length
030805ffffff // specify DTC/ITC and OCR bank sizes to be
pre-configured for the application (when not ff)
ffffffffffffffff
ffffffffffffffff
followed by further ff padding bytes
....
3 banks to be assigned to DTC, 8 to ITC and 5 to OCR

Does the number of banks include the mandatory 512k OCR banks on the 1062?

For example, in my app I have DTC = 512k, ITC = 0k, OCR = 512k
Would the header.txt be?:
Code: [Select]
02f8                   // first two bytes specify the length
0f000fffffff           // specify DTC/ITC and OCR
ffffffffffffffff
ffffffffffffffff

Also, in the example the byte count is shorter by than the blank 0xff padding, is this intentional?

25
oh, searching for that I also see a switch based on the define:
Code: [Select]
#define HS_USB_USES_FS
This seems to work for my purposes also.

Thanks!

26
I have a USB isolator (ADuM3160) on my design which limits he USB speed to 12 Mbps (FS) for the USB device port. 
The USB host port does not have this limitation.

Is there a way to define the USB ports of the iMX to be fullspeed on just the device port (or any port)?

I tried to change a few defines in iMX.h around line 1172, but it seems to configure both ports simultaneously, and I could not get USB_FS_INTERFACE to build at all.

Code: [Select]
// HSUART configuration
//
#define USB_HS_INTERFACE
#if defined iMX_RT105X || defined iMX_RT106X
    #define HSUSB_CONTROLLERS   2
#else
    #define HSUSB_CONTROLLERS   1
#endif
#define iMX_HSUSB_1             0
#define iMX_HSUSB_2             1
#define USBS_AVAILABLE          HSUSB_CONTROLLERS

27
OK, maybe this was obvious, but I didn't see it in the docs...

You need to set the Build Variable specifically for the Embedded Artists board. 

The default is MIMXRT1060, which is the correct part, but for the EA module, it should be iMX_RT1062_EMB_ART

28
OK,  moving on to building my existing NXP SDK application...

I made the appropriate changes to my application and generated a loadable .bin

Trying to actually load the file with the SerialLoader (via SD Card)  throws an error "File oversized!"

The application is 2.3MB, which should leave plenty of room in flash (4MB - bootLoader area).

I did some searching for the error in the SerialLoader and I see in iMX.h that there is a define:
Code: [Select]
#define APPLICATION_FLASH_AREA_SIZE       (512 * 1024)                   // third area in QSPI flash reserved for firmware upload area
Does this need to be increased to use more of flash for my application?


29
µTasker general / MacOS version of uTasker utilities?
« on: May 08, 2021, 02:54:15 PM »
Is there a Mac version of uTaskerCombine compiled somewhere?

I did find the Mac version of uTaskerConvert here: https://www.utasker.com/forum/index.php?topic=1445.msg5514#msg5514, it does look a bit out of date.

Thanks

30
I am now trying to build the SerialLoader project on Mac using MCUXpresso.
I will update this post as I move to each step.

For the uTaskerBM_Loader (uTaskerBoot configuration), the post build step is supposed to call generate.bat (which isn't usable on Mac)

I replaced this with the direct call:
Code: [Select]
arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${ProjDirPath}/Applications/uTaskerBoot/MCUXpresso_iMX/uTaskerBM_loader/${BuildArtifactFileBaseName}_${TargetBoard}.bin"
I also rewrote this as generate.sh.  You will need to add the arm bin directory to your shell path to do it this way (in ~/.zshrc on Big Sur).  Here is the generate.sh for uTaskerBoot build config:
Code: [Select]
#!/bin/sh

TARGET_DIR="../Applications/uTaskerBoot/MCUXpresso_iMX"
echo "TARGET_DIR:$TARGET_DIR"

BM_TARGET_DIR="$TARGET_DIR/uTaskerBM_Loader"
echo "BM_TARGET_DIR:$BM_TARGET_DIR"

TARGET="$TARGET_DIR/uTaskerBM_loader_$1.bin"
echo "TARGET:$TARGET"

#rem generate a binary output file
arm-none-eabi-objcopy -v -O binary "uTaskerBM_loader.axf" "$TARGET"


I also rewrote the generate script for uTaskerFallbackLoader and uTaskerSerialLoader, but I could only find a Mac version of uTaskerConvert, not uTaskerCombine...   so this won't completely work (yet?)

Code: [Select]
#!/bin/sh

OFFSET="0x10000"
if [ $2 == "MIMXRT1050" ];
then
  OFFSET="0x40000"
fi
echo "OFFSET:$OFFSET"

TOOLS_DIR="../Tools"
echo "TOOLS_DIR:$TOOLS_DIR"

TARGET_DIR="../Applications/uTaskerSerialBoot/MCUXpresso_iMX"
echo "TARGET_DIR:$TARGET_DIR"

BM_TARGET_DIR="$TARGET_DIR/uTaskerBM_loader"
echo "BM_TARGET_DIR:$BM_TARGET_DIR"

SERIAL_TARGET_DIR="$TARGET_DIR/uTaskerSerialLoader"
echo "SERIAL_TARGET_DIR:$SERIAL_TARGET_DIR"

TARGET="$TARGET_DIR/uTaskerFallbackLoaderImage_$2.bin"
echo "TARGET:$TARGET"


#rem generate a binary output file
arm-none-eabi-objcopy -v -O binary "uTaskerSerialLoader.axf" "$SERIAL_TARGET_DIR/uTaskerSerialLoader.bin"

#rem Encrypt using AES256
$TOOLS_DIR/uTaskerConvert "$SERIAL_TARGET_DIR/uTaskerSerialLoader.bin" "$SERIAL_TARGET_DIR/_temp.bin" $3 $4

#rem Add header and authentication to the encrypted image - this is uploaded to a board programmed with the uTaskerBootLoader [build without iMX_FALLBACK_SERIAL_LOADER]
$TOOLS_DIR/uTaskerConvert "$SERIAL_TARGET_DIR/_temp.bin" "$SERIAL_TARGET_DIR/uTaskerSerialLoaderUpload.bin" -0x9$5 -$6

if [ $1 == "0" ]
then
 cp "$SERIAL_TARGET_DIR/uTaskerSerialLoaderUpload.bin" "$SERIAL_TARGET_DIR/uTaskerSerialLoaderUpload_$2.bin"
fi

#rem combine the boot loader with the serial loader (fallback loader) - this image is loaded to a fresh board  [build with iMX_FALLBACK_SERIAL_LOADER]
$TOOLS_DIR/uTaskerCombine "$BM_TARGET_DIR/uTaskerBoot_$2.bin" "$SERIAL_TARGET_DIR/uTaskerSerialLoaderUpload.bin" 0x4000 "$SERIAL_TARGET_DIR/uTaskerBootLoaderImage.bin"

#rem - Prepare the Fall-back binary archive or combine the serial loader with the Fall-back loader
if [ $1 == "1" ]
then
  cp "$SERIAL_TARGET_DIR\uTaskerBootLoaderImage.bin" $TARGET 
else
  $TOOLS_DIR/uTaskerCombine $TARGET "$SERIAL_TARGET_DIR\uTaskerSerialLoaderUpload_$2.bin" $OFFSET[0x100-FALLBACK_LD] "$SERIAL_TARGET_DIR\uTaskerBootComplete_$2.bin" "$SERIAL_TARGET_DIR\uTaskerBootComplete_$2.hex"
fi

#rem Clean up
rm "$SERIAL_TARGET_DIR\_temp.bin"
rm "$SERIAL_TARGET_DIR\uTaskerSerialLoader.bin"
rm "$SERIAL_TARGET_DIR\uTaskerBootLoaderImage.bin"
rm "$SERIAL_TARGET_DIR\uTaskerSerialLoaderUpload.bin"

Here is the output from the uTaskerFallbackLoader build (as it stands now, it can't complete without uTaskerCombine)

Code: [Select]
09:23:08 **** Incremental Build of configuration uTaskerFallbackLoader for project uTaskerV1.4 ****
make -r -j19 all
Building target: uTaskerSerialLoader.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostartfiles -Xlinker -Map="uTaskerSerialLoader.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -T iMX_RT_10XX_FlexSPI_NOR_BOOT.ld -L "/Users/jackking/Documents/MCUXpressoIDE_11.2.0/workspace/uTaskerV1.4/Applications/uTaskerSerialBoot/GNU_iMX" -o "uTaskerSerialLoader.axf"  ./uTasker/utFAT/mass_storage.o  ./uTasker/uGLCDLIB/FT_CoPro_Cmds.o ./uTasker/uGLCDLIB/GLCD.o ./uTasker/uGLCDLIB/LCD.o  ./uTasker/MODBUS/MODBUS.o  ./uTasker/DSP.o ./uTasker/Driver.o ./uTasker/GlobalTimer.o ./uTasker/SPI_drv.o ./uTasker/SSC_drv.o ./uTasker/Tty_drv.o ./uTasker/USB_drv.o ./uTasker/Watchdog.o ./uTasker/can_drv.o ./uTasker/crypto.o ./uTasker/eth_drv.o ./uTasker/i2c_drv.o ./uTasker/low_power.o ./uTasker/time_keeper.o ./uTasker/uFile.o ./uTasker/uMalloc.o ./uTasker/uNetwork.o ./uTasker/uTasker.o  ./stack/SSL/wolfssl-3.9.6/w_aes.o  ./stack/SSL/openssl-1.0.2/aes_cbc.o ./stack/SSL/openssl-1.0.2/aes_core.o ./stack/SSL/openssl-1.0.2/cbc128.o  ./stack/SSL/mbedtls-1.3.10/aes_mbedTLS.o ./stack/SSL/mbedtls-1.3.10/sha256_mbedTLS.o  ./stack/PPP/auth.o ./stack/PPP/chap.o ./stack/PPP/chpms.o ./stack/PPP/fsm.o ./stack/PPP/ipcp.o ./stack/PPP/lcp.o ./stack/PPP/lwppp.o ./stack/PPP/magic.o ./stack/PPP/md5.o ./stack/PPP/pap.o ./stack/PPP/ppp_oe.o ./stack/PPP/randm.o ./stack/PPP/vj.o  ./stack/Ethernet.o ./stack/NetBIOS.o ./stack/arp.o ./stack/dhcp.o ./stack/dns.o ./stack/ftp.o ./stack/ftp_client.o ./stack/http.o ./stack/icmp.o ./stack/igmp.o ./stack/ip.o ./stack/ip_utils.o ./stack/mqtt.o ./stack/pop3.o ./stack/ppp.o ./stack/secure_layer.o ./stack/smtp.o ./stack/snmp.o ./stack/tcp.o ./stack/telnet.o ./stack/tftp.o ./stack/udp.o ./stack/webutils.o ./stack/zero_config.o  ./Hardware/iMX/iMX.o  ./Applications/uTaskerSerialBoot/disk_loader.o ./Applications/uTaskerSerialBoot/modbus_app.o ./Applications/uTaskerSerialBoot/serial_loader.o ./Applications/uTaskerSerialBoot/usb_application.o ./Applications/uTaskerSerialBoot/usb_device_loader.o ./Applications/uTaskerSerialBoot/usb_host_loader.o ./Applications/uTaskerSerialBoot/webInterface.o  ./Applications/uTaskerBoot/uTaskerBootLoader.o   
Memory region         Used Size  Region Size  %age Used
       SPI_FLASH:          0 GB         8 MB      0.00%
        SRAM_DTC:       13308 B       128 KB     10.15%
        SRAM_ITC:       39767 B       128 KB     30.34%
         SRAM_OC:          0 GB       128 KB      0.00%
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
     BOARD_SDRAM:          0 GB        32 MB      0.00%
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
Finished building target: uTaskerSerialLoader.axf
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
 
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
/Applications/MCUXpressoIDE_11.2.0_4120/ide/plugins/com.nxp.mcuxpresso.tools.macosx_11.2.0.202001021529/tools/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: warning: dot moved backwards before `.data_run'
make --no-print-directory post-build
Performing post-build steps
"/Users/jackking/Documents/MCUXpressoIDE_11.2.0/workspace/uTaskerV1.4/Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader/generate.sh" 1 MIMXRT1060 "aes256 secret key" "initial vector" 234 a748b6531124
OFFSET:0x10000
TOOLS_DIR:../Tools
TARGET_DIR:../Applications/uTaskerSerialBoot/MCUXpresso_iMX
BM_TARGET_DIR:../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerBM_loader
SERIAL_TARGET_DIR:../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader
TARGET:../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerFallbackLoaderImage_MIMXRT1060.bin
copy from `uTaskerSerialLoader.axf' [elf32-littlearm] to `../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader/uTaskerSerialLoader.bin' [binary]
      uTaskerConvert V1.11 - supporting encryption, AES256 and Motorola binary format [2M binary support]

      uTaskerConvert V1.11 - supporting encryption, AES256 and Motorola binary format [2M binary support]

/Users/jackking/Documents/MCUXpressoIDE_11.2.0/workspace/uTaskerV1.4/Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader/generate.sh: line 41: ../Tools/uTaskerCombine: No such file or directory
cp: ../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader\uTaskerBootLoaderImage.bin: No such file or directory
rm: ../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader\_temp.bin: No such file or directory
rm: ../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader\uTaskerSerialLoader.bin: No such file or directory
rm: ../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader\uTaskerBootLoaderImage.bin: No such file or directory
rm: ../Applications/uTaskerSerialBoot/MCUXpresso_iMX/uTaskerSerialLoader\uTaskerSerialLoaderUpload.bin: No such file or directory
make[1]: [makefile:55: post-build] Error 1 (ignored)
 

09:23:09 Build Finished. 0 errors, 6 warnings. (took 830ms)


Pages: 1 [2] 3