Quantcast
Channel: Processors forum - Recent Threads
Viewing all 17527 articles
Browse latest View live

Compiler/TDA2EVM5777: How can i re-execute LVDS_VIP_MULTI_CAM_SGX_DISPLAY usecase normally?

$
0
0

Part Number: TDA2EVM5777

Tool/software: TI C/C++ Compiler

Hi,

I did repeat 'execute apps -> choose lvds_vip_multi_cam_sgx_display usecase -> exit usecase -> exit apps -> re-execute apps'.

It runs normally almost times. However, sometimes some of four channles in capture link couldn't get any input data.

When that problem occured, i exited apps and executed again and it runs well.

I found that when apps is executed in linux+bios evironment, each core except for A15 runs infinite loop after first execution of apps.

However, i want to make all cores exited when i exit apps and started (i mean go to entry point of each core) when i executed apps.

Could you suggest any method to make that possible?

Regards,

Yoo 


CCS/AM3358: What is transparent mode for UART?

$
0
0

Part Number: AM3358

Tool/software: Code Composer Studio

What is the difference between transparent mode and uart mode for UART? Thanks

DRA712: LVDS output

$
0
0

Part Number: DRA712

Hi Experts,

Does DRA712 support the LVDS output?
It seems that it supports only LVDS input.

Thank you for your clarification.
Best regards,
Hitoshi

TDA2SG: 1080p image display on hdmi

$
0
0

Part Number: TDA2SG

Hi,

I tested as below for displaying the 1080p image  on hdmi for AVM Application.

Test Condition:

   SDK : PROCESSOR_SDK_VISION_03_07_00_00

   App : null_src_display

   modify : chains_nullSrcDisplay.c file

        for 1080p image

        #define NULLSRC_OUT_WIDTH               (1920)   //(1280)
        #define NULLSRC_OUT_HEIGHT              (1080)   //(720)

         for Black Image (0xFF -> 0x10)

              memset(
            pVideoFrame->bufAddr[0],
            0x10,//0xFF, 
            (NULLSRC_OUT_WIDTH * NULLSRC_OUT_HEIGHT));

Result : Create blue line on last line of image as below imge.

     

720p output is no problem. 

        #define NULLSRC_OUT_WIDTH               (1280)
        #define NULLSRC_OUT_HEIGHT              (720)

Pleaes give me advice to solve this problem ?

Regards,

JP

DRA712: H.264 profile level 4.0 or higher

$
0
0

Part Number: DRA712

Hi Experts,

I have a couple of questions for H.264 decoder.

Q1) Does it support the Profile Level 4.0 or higher?

Q2) Does it support both Baseline Profile : BP and Main Profile : MP?

I would like to know which document gives me such information.

Thank you for your kind check.
Best regards,
Hitoshi.

PROCESSOR-SDK-TDAX: [TDA4] RTOS+Linux demo application hangs on appRemoteServiceRun read call

$
0
0

Part Number: PROCESSOR-SDK-TDAX

Hello,

After running the vx_single_cam demo application, it hangs on appRemoteServiceRun function call.
In vision_apps/utils/remote_service/src/app_remote_service_linux.c, ln 153
there is a call to read() where the application hangs.
The whole log is attached. There are warnings about firmware that cannot be loaded:

** File not found /lib/firmware/j7-main-r5f1_0-fw **

.....
[  OK  ] Started Job spooling tools.
[   12.145645] pci-endpoint-test 0002:00:00.0: of_irq_parse_pci: failed with rc=-22
[  OK  ] Started Daily Cleanup of Temporary Directori[   12.156326] PVR_K:  176: Read BVNC 22.104.208.318 from HW device registers
es.
[  OK  ] Reached target Timers.
[   12.181157] pci_bus 0002:00: 1-byte config write to 0002:00:00.0 offset 0x3c may corrupt adjacent RW1C bits
[   12.194228] PVR_K:  176: RGX Device initialised with BVNC 22.104.208.318
[  OK  ] Started TEE Supplicant.
[   12.209824] [drm] Initialized pvr 1.10.5187610 20170530 for 4e20000000.gpu on minor 1
[   12.277062] img_dec 4300000.video-decoder: decoder registered as /dev/video0
         Starting RPC Bind Service...
[   12.360735] k3_r5_rproc interconnect@100000:interconnect@28380000:r5fss@41000000: creating child devices for R5F cores
[   12.443051] platform 41000000.r5f: configured R5F for remoteproc mode
[   12.482877] platform 41000000.r5f: assigned reserved memory node r5f-dma-memory@a0000000
[   12.491078] remoteproc remoteproc3: 41000000.r5f is available
[   12.496968] remoteproc remoteproc3: Direct firmware load for j7-mcu-r5f0_0-fw failed with error -2
[   12.503213] k3_r5_rproc interconnect@100000:r5fss@5c00000: creating child devices for R5F cores
[   12.506772] remoteproc remoteproc3: powering up 41000000.r5f
[   12.520343] remoteproc remoteproc3: Direct firmware load for j7-mcu-r5f0_0-fw failed with error -2
[   12.524020] platform 5c00000.r5f: R5F core may have been powered on by a different host, programmed state (0) != actual state (1)
[   12.531027] remoteproc remoteproc3: request_firmware failed: -2


There are no j7-mcu-r5f0_0-fw or j7-main-r5f1_0-fw firmware files on the target filesystem, are they needed and where can they be found?

Thanks,
Todor

(Please visit the site to view this file)

DRA712: Image data correction to curved display

$
0
0

Part Number: DRA712

Hi Experts,

I would like to utilize a curved screen display which not flat display.
Is it possible to add the image data correction to adjust the output screen shape?

Thank you for your check.
Best regards,
Hitoshi

66AK2H14: Lowest SPI Clock Rate

$
0
0

Part Number: 66AK2H14

Hello, I need to run my SPI Master below 100Khz but when I try I only see 1Mhz on the scope. What is the lowest SPI clock rate allowed?

Thank you,

Joe


CCS/TMS320DM6433: Compatibility with NOR Flash

$
0
0

Part Number: TMS320DM6433

Tool/software: Code Composer Studio

We're migrating from an obsolete NOR Flash chip (Cypress GL-P series S29GL512P11FFI020) to a new hardware-compatible chip (Cypress GL-T series S29GL512T10FHI020).

With the new flash installed I'm running into problems with the JTAG emulator (Spectrum Digital XDS510USB) being able to connect to the CPU. 

Error connecting to the target: Error 0x80000240/-140

Fatal Error during: Initialization, OCS, Error generated by SD scan controller module

Running the diagnostic in SDConfig yields:

Check Power to your emulator/eZdsp

Then check your port mode/address

This is with CCS 3.3 SR 9.79 (newer SRs break emulator functionality)

This exact configuration and driver works fine with the old flash chip. I can't think of any reason the flash module would impact the JTAG debugger.... any ideas?

Secondarily, are there any boot timing incompatibilities between the DM6433 and the GL-T NOR Flash? Or are there a list of supported / unsupported Flash chips for this processor?

AM5749: Processor recommendation

$
0
0

Part Number: AM5749

Hi Team

 We need a processor to design a product , some of the requirment attach below. Can you suggest a TI processor ? 

1. > 1.5GHz 

2. support 4 channel 1080p camera input and H265 hardware coder and decoder and save to HDD. (Key requirment)

3. 2CH G Ethernet port,

4. 1 ch sata3.0

5. 1 ch USB3.0 , 2ch USB2.0

TMS320C6678: Reserved Pins functions

$
0
0

Part Number: TMS320C6678

In the current documentation for the TMS320C6678 it is noted that pin AH19 RSV08 should be shorted to GND.  What are the possible consequences if the pin was left floating?

CCS/AM3358: UART_DMATestApplication

$
0
0

Part Number: AM3358

Tool/software: Code Composer Studio

Unit Test application with DMA mode or any uart dma example project. Thanks

TMS320C6678: Activity on Core0 is causing unwanted "stalling" on Core1

$
0
0

Part Number: TMS320C6678

Greetings,

I am running my Application code on Core1 (closed-loop servo controller with HWI + SWI running at 100KHz) and my outside-world Communication code running on Core0 (Ethernet).

In this scenario, there is no intentional interaction between the cores - Core0 receives a comm request, pulls the info from DRAM, and transmits it out.

But I'm seeing intermittent, significant "stalling" of my Core1 100KHz SWI when the comm on Core0 is active.

Both Cores use the DRAM, and I assume there must be some arbitration going on between the cores.

QUESTION: So when Core0 is accessing the DRAM, is Core1 somehow "held off" for some period of time (i.e. more than a few microseconds)?  If so, do I have any control over this?

Blaming the DRAM is just a stab-in-the-dark on my part.  If someone believes it to be something else, please don't hesitate to suggest it!

Thank you,

Eric

TDA3LA: Formula to calculate PkDetect target energy

$
0
0

Part Number: TDA3LA

Hi,

I would like to understand what's the formula used to calculate the target energy in PkDetect Alg in Vision SDK. I was given the C source file in peak_detection_tb.c to look but I can't seem to follow the code very well to figure out. Can you please provide the formula? The PkDetect input is 1 or more RX channel's RDMs.

Thanks,

--Khai

AM5728: panel-dpi driver: where does enable-gpio and reset-gpio timing come from?

$
0
0

Part Number: AM5728

I'm currently debugging a problem that may have to do with a particular RGB LCD panel needing to stay in reset for a little longer than the kernel currently holds it.  I tried changing my reset-gpios line to an enable-gpios line and got a different behavior, but I'd also like to extend the reset timing.  Where are these timings configured?  Are they hard-coded somewhere in the kernel?

The display in question is actually a MIPI display at the far end of a RGB -> LVDS -> MIPI conversion chain (since AM5728 doesn't support MIPI DSI), but I don't think that detail is important here.

Thanks!


TDA4: SOM and Common Processor Board schematic / layout questions

$
0
0

Some questions related the TDA4 EVM SOM schematics and layout. 

1) We had the E5 schematics and noted that newer schematics are coming out very soon.  We've been asked to identify, or at least outline what the changes are from “E5” to “E7” will be, what the affected circuits and function are? 

2) On the Common Processor Board, we have several FLASH components, among them is a UFS device.  What is the intent or use case for it?

3) it was noted that different supply information between the Common Processor Board power flow and power sequence diagrams on schematic pgs 5 and 6 (PROC079E2A) versus the notes within the schematic for the LM5175, LM5141, and LM5140.

4) Noted that the VDD_IO (SHV) voltage for the system is 3.3V, rather than 1.8V. What is the reason for this?

5) The SOM layout design is generating a number of uncommented DRC’s.  We are wondering if these had been reviewed. We would like to understand what has been built and the impact and risk of those items that are reported.

 

AM3358: Unable to use UART1,2,4 when booting default image from SDK

$
0
0

Part Number: AM3358

  • TI Processor SDK 06_00_00_07
  • Host computer: Ubuntu 18.04
  • Development board: Beaglebone Black rev-C (BBB)
  • (1) 16GB micro SD card with Debian BeagleBoard image. I used dd command with beagle board image to create this card.
  • (1) 16GB micro SD card with TI default tisdk-rootfs-image-am335x-evm.tar.gz image from SDK. I run /bin/create-sdcard.sh to create this SDcard.

I have a (2) MAX232 RS-232 chip connected to UART1,2,4 proven to work. My host: ttyS0 (physical RS-232 port) is connected to BBB: UART-4 via 9-pin RS-232 cable. My host: ttyUSB0 is connected to BBB: UART-0 (6-pin header) via FTDI cable.

  1. On my host, start putty session connect to host: ttyS0
  2. On my host, start minicom session connected to host: ttyUSB0.
  3. Boot Debian BeagleBoard image from SDcard, watch host: minicom session and wait for boot to complete
  4. Login as debian
  5. Type 'sudo echo "12345 From UART-4" > /dev/ttyS4'

Checking putty will show "12345 From UART-4" which proves BBB: ttyS4 (UART-4) can open and send text.

  1. On my host, start putty session connect to host: ttyS0
  2. On my host, start minicom session connected to host: ttyUSB0
  3. Boot TI default image from SDcard, watch host: minicom session and wait for boot to complete
  4. Login as root
  5. Type 'sudo echo "12345 From UART-4" > /dev/ttyS4'

Checking putty shows no message. Checking minicom shows BBB error '-sh: echo: write error: Input/output error'.

How do I enable UART1,2,4 (ttyS1,ttyS2,ttyS4) in the TI default image?

Thank you,

Compiler/PROCESSOR-SDK-AM335X: PRU pru_rpmsg_send sets FROM_ARM_HOST interrupt?

$
0
0

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI C/C++ Compiler

I'm trying to make PRU talk to ARM host in a beaglebone. The difficulty is I want to check on both ends to see if the other side has sent any message, in a non-blocking fashion.

On the host side, just polling and reading on /dev/rpmsg_pru30 and /dev/rpmsg_pru31 seems to be good enough.

On the PRU side, I'm having a problem with too many interrupts.

I'm using

CT_INTC.SICR = FROM_ARM_HOST;

to clear the interrupt, and

#define CHAN_PORT       30
#define CHAN_DESC   "Channel 30"
#define TO_ARM_HOST     16
#define FROM_ARM_HOST   17
#define INT_MASK            ((uint32_t)1 << CHAN_PORT)
#define FROM_ARM_MASK       ((uint32_t)1 << FROM_ARM_HOST)

if (((__R31 & INT_MASK) && (CT_INTC.SECR0 & FROM_ARM_MASK)) != 0) {...}

(Both FROM_ARM_HOST and TO_ARM_HOST are set using pru_rpmsg_init.)

to check for the interrupt for PRU0. I also clear the interrupt after every read.

It seems to work fine when I"m just receiving message from the host. However, if I send a message from PRU0 to ARM host, the interrupt is on but since there was nothing to read from ARM to PRU0, the reading fails.

It doesn't help if I immediately clear the interrupt after the send. The clearing seems to work, however, if I send message from PRU0 to ARM, wait for about 4E5 cycles, clear the interrupt, wait for the next message from ARM, then it works (the interrupt is cleared and next interrupt from ARM to PRU0 is registered normally).

I don't understand why the interrupt on this two way channel is not reliable. Is there something I did wrong? If I try to clear the interrupt with CT_INTC.SICR_bit.STS_CLR_IDX = FROM_ARM_HOST I see the same problem. If I check the interrupt simply with if (__R31 & HOST_INT) like in the lab examples, the flag is always true and never gets cleared.

TDA2P-ACD: unable to boot from lzma initrd with linux

$
0
0

Part Number: TDA2P-ACD

I am able to boot with initramfs with lzma compression.

i have 20 block of 4MB /ramdisk allocation and size of compressed fs is 14MB and of uncompress is 70 MB

env:

arch=arm
baudrate=115200
board=dra7xx
board_name=dra7xx
boot_fdt=try
boot_os=0
bootargs=androidboot.serialno=${serial#}
bootargs_base=setenv bootargs console=${console} stdin=${stdin} stdout=${stdout} stderr=${stderr} ro enable_wait_mode=off earlyprintk
bootargs_initramfs=run bootargs_base; setenv bootargs ${bootargs} rdinit=/sbin/init noinitrd
bootcmd=run bootcmd_cf_nor
bootcmd_cf_nor=run bootargs_initramfs uimage_load_nor initramfs_load_nor;bootm ${loadaddr} ${loadaddr_initramfs} ${fdt_addr}
bootdelay=2
bootdir=/boot
bootfile=zImage
bootm_size=0x10000000
bootpart=0:2
console=ttyO2,115200n8
cpu=armv7
dofastboot=0
ethaddr=04:79:b7:90:e0:a8
fdt_addr=0x88000000
fdt_addr_r=0x88000000
fdt_high=0xffffffff
fdt_offset=0x08180000
fdt_size=0x8000
fdtaddr=0x88000000
fdtcontroladdr=beee3598
fdtfile=undefined
findfdt=if test $board_name = dra7xx; then setenv fdtfile dra7-evm.dtb; fi;if test $board_name = dra76x; then setenv fdtfile dra76-evm.dtb; fi;if test $board_findfdt != undefined; then run board_findfdt; fi;if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
initramfs_copy_cmd=cp
initramfs_load_nor=${initramfs_copy_cmd} ${initramfs_offset} ${loadaddr_initramfs} ${initramfs_size}
initramfs_offset=0x086C0000
initramfs_size=0x00A00000
initrd_high=0xffffffff
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadaddr_initramfs=0x88080000
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
netloadfdt=tftp ${fdtaddr} ${fdtfile}
netloadimage=tftp ${loadaddr} ${bootfile}
nfsopts=nolock
pxefile_addr_r=0x80100000
ramdisk_addr_r=0x88080000
rdaddr=0x88080000
reboot_image=boot
rootpath=/export/rootfs
scriptaddr=0x80000000
soc=omap5
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial@48020000
stdin=serial@48020000
stdout=serial@48020000
uimage_copy_cmd=cp
uimage_load_nor=${uimage_copy_cmd} ${fdt_offset} ${fdt_addr} ${fdt_size} && ${uimage_copy_cmd} ${uimage_offset} ${loadaddr} ${uimage_size}
uimage_offset=0x081C0000
uimage_size=0x100000
usbtty=cdc_acm
vendor=ti
ver=U-Boot 2016.05-00064-gc7cf5219c4ca (Jun 28 2019 - 17:42:48 -0400)
vram=16M

LOG:


U-Boot 2016.05-00064-gc7cf5219c4ca (Jun 28 2019 - 17:42:48 -0400)

CPU : DRA762-GP ES1.0
Model: TI DRA742
Board: AVPIM Proto Mar 2019 REV 01
DRAM: Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
0 Bytes
*** Warning - bad CRC, using default environment

Net: Could not get PHY for ethernet@48484000: addr 2

Warning: ethernet@48484000 using MAC address from ROM
eth0: ethernet@48484000
Hit any key to stop autoboot: 0
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux uImage
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3472704 Bytes = 3.3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 88080000 ...
Image Name: Ramdisk Image
Image Type: ARM Linux RAMDisk Image (lzma compressed)
Data Size: 14662886 Bytes = 14 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image ... OK
Using Device Tree in place at 88000000, end 8801c9ac

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.84-00052-ga2ee5f975a0b-dirty (root@ubuntu-b3f523dc-be13-4dcc-9b90-711edd516ef9) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #20 PREEMPT Tue Aug 20 20:31:32 EDT 2019
[ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=30c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] Machine model: TI DRA762 EVM
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] Reserved memory: created DMA memory pool at 0x0000000040300000, size 3 MiB
[ 0.000000] Reserved memory: initialized node cmem@40300000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: regions without no-map are not yet supported
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000099000000, size 80 MiB
[ 0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000009e000000, size 32 MiB
[ 0.000000] Reserved memory: initialized node ipu1_cma@9d000000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 24 MiB at 0x0000000095800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] OMAP4: Map 0x000000009fd00000 to fe600000 for dram barrier
[ 0.000000] Hit pending asynchronous external abort (FSR=0x00000211) during first unmask, this is most likely caused by a firmware/bootloader bug.
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm/kernel/devtree.c:157 arm_dt_init_cpu_maps+0x140/0x180()
[ 0.000000] DT /cpu 2 nodes greater than max cores 1, capping them
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.84-00052-ga2ee5f975a0b-dirty #20
[ 0.000000] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 0.000000] Backtrace:
[ 0.000000] [<c0013330>] (dump_backtrace) from [<c001352c>] (show_stack+0x18/0x1c)
[ 0.000000] r7:c08e9a2c r6:0000009d r5:00000009 r4:00000000
[ 0.000000] [<c0013514>] (show_stack) from [<c02aeecc>] (dump_stack+0x24/0x28)
[ 0.000000] [<c02aeea8>] (dump_stack) from [<c0037324>] (warn_slowpath_common+0x88/0xb4)
[ 0.000000] [<c003729c>] (warn_slowpath_common) from [<c0037388>] (warn_slowpath_fmt+0x38/0x40)
[ 0.000000] r8:00000001 r7:c0827a68 r6:c081edb0 r5:00000000 r4:c081ee48
[ 0.000000] [<c0037354>] (warn_slowpath_fmt) from [<c08e9a2c>] (arm_dt_init_cpu_maps+0x140/0x180)
[ 0.000000] r3:00000002 r2:c081ee48
[ 0.000000] r4:d52d2ecc
[ 0.000000] [<c08e98ec>] (arm_dt_init_cpu_maps) from [<c08e8fb0>] (setup_arch+0x1a0/0x208)
[ 0.000000] r9:412fc0f2 r8:80007000 r7:c0936874 r6:c0920a18 r5:c093204c r4:c097f140
[ 0.000000] [<c08e8e10>] (setup_arch) from [<c08e2494>] (start_kernel+0x60/0x558)
[ 0.000000] [<c08e2434>] (start_kernel) from [<8000808c>] (0x8000808c)
[ 0.000000] ---[ end trace cb88537fdc8fa200 ]---
[ 0.000000] CPU: All CPU(s) started in HYP mode.
[ 0.000000] CPU: Virtualization extensions available.
[ 0.000000] DRA762 ES1.0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129152
[ 0.000000] Kernel command line: console=ttyO2,115200n8 stdin=serial@48020000 stdout=serial@48020000 stderr=serial@48020000 ro enable_wait_mode=off earlyprintk rdinit=/sbin/init noinitrd
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 322104K/521216K available (6691K kernel code, 311K rwdata, 2368K rodata, 312K init, 270K bss, 59848K reserved, 139264K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc08e100c (9061 kB)
[ 0.000000] .init : 0xc08e2000 - 0xc0930000 ( 312 kB)
[ 0.000000] .data : 0xc0930000 - 0xc097dcf8 ( 312 kB)
[ 0.000000] .bss : 0xc097f000 - 0xc09c2b58 ( 271 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] ti_dt_clocks_register: failed to lookup clock node gmac_gmii_ref_clk_div
[ 0.000000] OMAP clockevent source: timer1 at 32786 Hz
[ 0.000000] Architected cp15 timer(s) running at 6.14MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x16af5adb9, max_idle_ns: 440795202250 ns
[ 0.000004] sched_clock: 56 bits at 6MHz, resolution 162ns, wraps every 4398046511023ns
[ 0.008303] Switching to timer-based delay loop, resolution 162ns
[ 0.014948] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
[ 0.025208] OMAP clocksource: 32k_counter at 32768 Hz
[ 0.030914] Console: colour dummy device 80x30
[ 0.035564] WARNING: Your 'console=ttyO2' has been replaced by 'ttyS2'
[ 0.042352] This ensures that you still see kernel messages. Please
[ 0.048861] update your kernel commandline.
[ 0.053242] Calibrating delay loop (skipped), value calculated using timer frequency.. 12.29 BogoMIPS (lpj=61475)
[ 0.063862] pid_max: default: 32768 minimum: 301
[ 0.068740] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.075619] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.083350] Initializing cgroup subsys io
[ 0.087561] Initializing cgroup subsys memory
[ 0.092128] Initializing cgroup subsys devices
[ 0.096773] Initializing cgroup subsys freezer
[ 0.101422] Initializing cgroup subsys perf_event
[ 0.106332] Initializing cgroup subsys pids
[ 0.110716] CPU: Testing write buffer coherency: ok
[ 0.115960] Setting up static identity map for 0x80008300 - 0x80008360
[ 0.123363] devtmpfs: initialized
[ 0.150236] VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
[ 0.158806] omap_hwmod: l3_main_2 using broken dt data from ocp
[ 0.318317] omap_hwmod: timer13: _wait_target_ready failed: -16
[ 0.324478] omap_hwmod: timer13: cannot be enabled for reset (3)
[ 0.333300] omap_hwmod: timer14: _wait_target_ready failed: -16
[ 0.339459] omap_hwmod: timer14: cannot be enabled for reset (3)
[ 0.348282] omap_hwmod: timer15: _wait_target_ready failed: -16
[ 0.354440] omap_hwmod: timer15: cannot be enabled for reset (3)
[ 0.363265] omap_hwmod: timer16: _wait_target_ready failed: -16
[ 0.369418] omap_hwmod: timer16: cannot be enabled for reset (3)
[ 0.376217] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.386412] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.396144] ------------[ cut here ]------------
[ 0.401010] WARNING: CPU: 0 PID: 1 at mm/cma.c:117 cma_init_reserved_areas+0x13c/0x21c()
[ 0.409391] Modules linked in:
[ 0.412617] CPU: 0 PID: 1 Comm: swapper Tainted: G W 4.4.84-00052-ga2ee5f975a0b-dirty #20
[ 0.422252] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 0.428590] Backtrace:
[ 0.431190] [<c0013330>] (dump_backtrace) from [<c001352c>] (show_stack+0x18/0x1c)
[ 0.439043] r7:c08fe2d4 r6:00000075 r5:00000009 r4:00000000
[ 0.444949] [<c0013514>] (show_stack) from [<c02aeecc>] (dump_stack+0x24/0x28)
[ 0.452455] [<c02aeea8>] (dump_stack) from [<c0037324>] (warn_slowpath_common+0x88/0xb4)
[ 0.460847] [<c003729c>] (warn_slowpath_common) from [<c00373f4>] (warn_slowpath_null+0x24/0x2c)
[ 0.469942] r8:024080c0 r7:c097b498 r6:0009fd00 r5:c082e37c r4:0009fc00
[ 0.476918] [<c00373d0>] (warn_slowpath_null) from [<c08fe2d4>] (cma_init_reserved_areas+0x13c/0x21c)
[ 0.486476] [<c08fe198>] (cma_init_reserved_areas) from [<c0009884>] (do_one_initcall+0x70/0x198)
[ 0.495660] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c068a598
[ 0.503795] r4:00000000
[ 0.506481] [<c0009814>] (do_one_initcall) from [<c08e359c>] (do_initcall_level+0xe8/0x120)
[ 0.515137] [<c08e34b4>] (do_initcall_level) from [<c08e35f8>] (do_initcalls+0x24/0x48)
[ 0.523430] [<c08e35d4>] (do_initcalls) from [<c08e3648>] (do_basic_setup+0x2c/0x38)
[ 0.531465] [<c08e361c>] (do_basic_setup) from [<c08e398c>] (kernel_init_freeable+0x2dc/0x388)
[ 0.540384] [<c08e36b0>] (kernel_init_freeable) from [<c068a5b0>] (kernel_init+0x18/0x180)
[ 0.548958] [<c068a598>] (kernel_init) from [<c000fc68>] (ret_from_fork+0x14/0x2c)
[ 0.556804] ---[ end trace cb88537fdc8fa201 ]---
[ 0.562542] pinctrl core: initialized pinctrl subsystem
[ 0.568641] NET: Registered protocol family 16
[ 0.574008] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.603332] cpuidle: using governor ladder
[ 0.633345] cpuidle: using governor menu
[ 0.644355] OMAP GPIO hardware version 0.1
[ 0.653603] irq: no irq domain found for /ocp/l4@4a000000/scm@2000/pinmux@1400 !
[ 0.677831] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.686142] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.692632] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[ 0.700318] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[ 0.708331] OMAP DMA hardware revision 0.0
[ 0.751161] omap-dma-engine 4a056000.dma-controller: OMAP DMA engine driver (LinkedList1/2/3 supported)
[ 0.761727] edma 43300000.edma: memcpy is disabled
[ 0.770347] edma 43300000.edma: TI EDMA DMA engine driver
[ 0.779368] omap-iommu 40d01000.mmu: 40d01000.mmu registered
[ 0.785376] omap-iommu 40d02000.mmu: 40d02000.mmu registered
[ 0.791374] omap-iommu 58882000.mmu: 58882000.mmu registered
[ 0.797363] omap-iommu 55082000.mmu: 55082000.mmu registered
[ 0.803439] omap-iommu 41501000.mmu: 41501000.mmu registered
[ 0.809455] omap-iommu 41502000.mmu: 41502000.mmu registered
[ 0.817949] palmas 0-0058: IRQ missing: skipping irq request
[ 0.835643] palmas 0-0058: Muxing GPIO 0, PWM 3, LED 0
[ 0.844651] smps5: failed to get the current voltage(-22)
[ 0.850362] palmas-pmic 48070000.i2c:tps65917@58:tps65917_pmic: failed to register 48070000.i2c:tps65917@58:tps65917_pmic regulator
[ 0.862777] palmas-pmic: probe of 48070000.i2c:tps65917@58:tps65917_pmic failed with error -22
[ 0.871790] irq: no irq domain found for /ocp/i2c@48070000/tps65917@58 !
[ 0.879191] pcf857x: probe of 0-0020 failed with error -121
[ 0.885188] pcf857x: probe of 0-0021 failed with error -121
[ 0.891183] pcf857x: probe of 0-0026 failed with error -121
[ 0.897004] omap_i2c 48070000.i2c: bus 0 rev0.12 at 400 kHz
[ 0.903142] omap_i2c 48060000.i2c: bus 2 rev0.12 at 400 kHz
[ 0.909076] media: Linux media interface: v0.10
[ 0.913857] Linux video capture interface: v2.00
[ 0.918708] pps_core: LinuxPPS API ver. 1 registered
[ 0.923888] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.933360] PTP clock support registered
[ 0.937512] EDAC MC: Ver: 3.0.0
[ 0.941399] omap-mailbox 48840000.mailbox: omap mailbox rev 0x400
[ 0.947995] omap-mailbox 48842000.mailbox: omap mailbox rev 0x400
[ 0.954572] Advanced Linux Sound Architecture Driver Initialized.
[ 0.961571] clocksource: Switched to clocksource arch_sys_counter
[ 0.975174] NET: Registered protocol family 2
[ 0.980121] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.987480] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.994228] TCP: Hash tables configured (established 4096 bind 4096)
[ 1.000858] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.006949] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.013554] NET: Registered protocol family 1
[ 1.018271] RPC: Registered named UNIX socket transport module.
[ 1.024454] RPC: Registered udp transport module.
[ 1.029364] RPC: Registered tcp transport module.
[ 1.034279] RPC: Registered tcp NFSv4.1 backchannel transport module.
á compressed dataected
á); looks like an initrdame (
[ 1.050694] before decompress_methodcan you see this data 486line
[ 1.057035] buf addr c092e940
[ 1.060158] buf length 134
[ 1.063037] Compressed data magic: 0x1f 0x8b
[ 1.067499] name of the zipthingy ¨
[ 1.071247] Do we have a name here
[ 1.074916] Detected gzip compressed data
[ 1.079110] 62 is buf set, if so you will see this
[ 1.084122] this is after rc line counter=0 132
[ 1.089117] this is before zlib_inflate line 144
[ 1.094043] this is after zlib_inflate line 146
[ 1.099040] 157 flush is c08e67d0 strm->next_out is d4f50200 out_buf is d4f50000 l is 512
422 len is 512 byte_count is 396 result is 116
[ 1.112540] 422 len is 396 byte_count is 272 result is 124
[ 1.118365] 422 len is 272 byte_count is 156 result is 116
[ 1.124198] 422 len is 156 byte_count is 0 result is 156
[ 1.129819] 446 buf is d4f50164 bufv is d4f50000 origlen is 512 len is 156
[ 1.137071] 164 l = flush(out_buf,l)
[ 1.140816] this is before zlib_inflateEnd line 171
[ 1.146006] this is after zlib_inflateEnd line 171
[ 1.151097] this is rc crap 0
[ 1.154230] this_header 0l
[ 1.157086] right below dir_utime
[ 1.160579] Trying to unpack rootfs image as initramfs...
[ 1.166216] Detected
ÐKâ compressed data
[ 1.170410] compress_name (
ÐKâ); looks like an initrd
[ 1.175772] before decompress_methodcan you see this data 486line
[ 1.182113] buf addr c8080040
[ 1.185237] buf length 14662886
[ 1.188540] Compressed data magic: 0x5d 0x00
[ 1.193009] name of the zipthingy ¨
[ 1.196758] Do we have a name here
[ 1.200416] Detected lzma compressed data

Linux/AM5728: C66x cannot deal with the interrupts from PWM with 16Khz

$
0
0

Part Number: AM5728

Tool/software: Linux

Hello,

The experiment environment:

  • AM5728 IDK Board
  • ti-processor_sdk_rtos_am57xx_4_03_00_05 and CSL ePWM examples for C66 and M4
  • PROCESSOR-SDK-LINUX-RT-AM57X for A15

The experiment step:

  1. Boot the board and stop at UBoot
  2. Release C66 and load code of ePWM (attached in the end)
  3. Use UBoot command to
    1. enable epwm interrupt
    2. wait for 10 sec
    3. disable epwm interrupt
  4. Check the value of the counter, which is 0x40301000, to get the numbers of the ePWM interrupt handled by C66x.

The following figure has shown C66x cannot deal with 16Khz interrupts from ePWM. However, it seems easy for M4 to deal with 50Khz interrupt from ePWM. I have put everything (code, data, stack, ..) into internal SRAM to make C66x as busy as possible. Could someone provide any comment?

/*
 *  Copyright (c) Texas Instruments Incorporated 2017
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/**
 *  \file     epwm_app.c
 *
 *  \brief    This file contains PWM test application which sets a particular
 *            duty cycle in PWMSS1 output A (EHRPWM1A) which can be verified
 *            through external pin probing.
 */

/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */

#include "epwm_app.h"

/* ========================================================================== */
/*                                Macros                                      */
/* ========================================================================== */

/*
 * Configurable parameters
 */
/**
 *  \brief PWM instance base address.
 *
 *  Note: If changed to other instance, PRCM and pinmux changes needs to be
 *  taken care in the application.
 */
#define APP_EHRPWM_INST_BASE_ADDR       (SOC_PWMSS1_IPWMSS_BASE)

/**
 *  \brief Output channel - A or B.
 *
 *  Note: If changed to channel B, pinmux changes needs to be taken care
 *  in the application.
 */
#define APP_EHRPWM_OUTPUT_CH            (CSL_EPWM_OUTPUT_CH_A)

/** \brief Frequency of PWM output signal in Hz - 1 KHz is selected */
#define APP_EHRPWM_OUT_FREQ             50000 //(1U * 1000U)

/** \brief Duty Cycle of PWM output signal in % - give value from 0 to 100 */
#define APP_EHRPWM_DUTY_CYCLE           (25U)

/** \brief APP run time in seconds */
#define APP_RUN_TIME                    (10U)

/** \brief APP run count in event equal zero ISR count */
#define APP_RUN_TIME_ISRCOUNT           (APP_RUN_TIME * APP_EHRPWM_OUT_FREQ)

/**
 *  \brief Functional clock to the PWMSS.
 *  Fixed for the platform - can't be changed.
 */
#define SOC_EHRPWM_MODULE_FREQ          (133U * 1000U * 1000U)

/** \brief TB frequency in Hz - so that /4 divider is used */
#define APP_EHRPWM_TB_FREQ              (SOC_EHRPWM_MODULE_FREQ / 4U)

/**
 *  \brief PRD value - this determines the period
 *
 *  PRD = (TBCLK/PWM FREQ) / 2
 *  NOTE: /2 is added becasue up&down counter is selected. So period is 2 times
 */
#define APP_EHRPWM_PRD_VAL              ((APP_EHRPWM_TB_FREQ                   \
                                            / APP_EHRPWM_OUT_FREQ) / 2U)
/**
 *  \brief COMPA value - this determines the duty cycle
 *
 *  COMPA = (PRD - ((dutycycle * PRD) / 100)
 */
#define APP_EHRPWM_COMPA_VAL            (APP_EHRPWM_PRD_VAL -                  \
                                            ((APP_EHRPWM_DUTY_CYCLE *          \
                                                APP_EHRPWM_PRD_VAL) / 100U))

/*
#define APP_EHRPWM_INT                  (32U)
#define APP_EHRPWM_XBAR_CPU             (CSL_XBAR_IRQ_CPU_ID_IPU1)
#define APP_EHRPWM_XBAR_INST            (CSL_XBAR_INST_IPU1_IRQ_32)
#define APP_EHRPWM_XBAR_INTR_SOURCE     (CSL_XBAR_PWMSS1_IRQ_ePWM0INT)
*/

#define APP_EHRPWM_INT                  (32U)
#define APP_EHRPWM_XBAR_CPU             (CSL_XBAR_IRQ_CPU_ID_DSP1)
#define APP_EHRPWM_XBAR_INST            (CSL_XBAR_INST_DSP1_IRQ_32)
#define APP_EHRPWM_XBAR_INTR_SOURCE     (CSL_XBAR_PWMSS1_IRQ_ePWM0INT)
 

/* ========================================================================== */
/*                            Global Variables                                */
/* ========================================================================== */

/** \brief IP default configuration */
static CSL_EpwmAppPwmObj_t gAppPwmObj =
{
    APP_EHRPWM_OUTPUT_CH,                       /* pwmCh */
    APP_EHRPWM_INST_BASE_ADDR,                  /* instAddr */
    SOC_EHRPWM_MODULE_FREQ,                     /* funcClk */
    FALSE,                                      /* enableDeadband */
    FALSE,                                      /* enableChopper */
    FALSE,                                      /* enableTripzone */
    TRUE,                                       /* enableEventTrigger */
    FALSE,                                      /* enableHighResolution */
    /* CSL_EpwmAppPwmCfg_t*/
    {
        /* CSL_EpwmTimebaseCfg_t */
        {
            APP_EHRPWM_TB_FREQ,                 /* tbClk */
            APP_EHRPWM_OUT_FREQ,                /* pwmtbCounterFreqPrd */
            CSL_EPWM_TB_COUNTER_DIR_UP_DOWN,    /* tbCntrDirection */
            FALSE,                              /* enableSynchronization */
            PWMSS_EPWM_TBCTL_PHSDIR_COUNT_DOWN, /* cntDirAfterSync */
            0U,                                 /* phsCountAfterSync */
            PWMSS_EPWM_TBCTL_SYNCOSEL_EPWMXSYNC /* syncOutSrc */
        },
        /* CSL_EpwmCounterCmpCfg_t */
        {
            APP_EHRPWM_COMPA_VAL,               /* cmpAValue */
            APP_EHRPWM_COMPA_VAL                /* cmpBValue */
        },
        /* CSL_EpwmAqActionCfg_t */
        {
            CSL_EPWM_AQ_ACTION_DONOTHING,       /* zeroAction */
            CSL_EPWM_AQ_ACTION_DONOTHING,       /* prdAction */
            CSL_EPWM_AQ_ACTION_HIGH,            /* cmpAUpAction */
            CSL_EPWM_AQ_ACTION_LOW,             /* cmpADownAction */
            CSL_EPWM_AQ_ACTION_HIGH,            /* cmpBUpAction */
            CSL_EPWM_AQ_ACTION_LOW              /* cmpBDownAction */
        },
        /* CSL_EpwmDeadbandCfg_t */
        {
            CSL_EPWM_DB_IN_MODE_A_RED_A_FED,    /* inputMode */
            CSL_EPWM_DB_OUT_MODE_BYPASS,        /* outputMode */
            CSL_EPWM_DB_POL_SEL_ACTV_HIGH,      /* polaritySelect */
            0U,                                 /* risingEdgeDelay */
            0U                                  /* fallingEdgeDelay */
        },
        /* CSL_EpwmChopperCfg_t */
        {
            CSL_EPWM_CHP_DUTY_CYCLE_PERC_12PNT5,    /* dutyCycle */
            CSL_EPWM_CHP_CLK_FREQ_DIV_BY_1,         /* clkFrequency */
            CSL_EPWM_CHP_OSHT_WIDTH_1XSYSOUT_BY_8   /* oneShotPulseWidth */
        },
        /* CSL_EpwmTripzoneCfg_t */
        {
            CSL_EPWM_TZ_TRIP_ACTION_DO_NOTHING, /* tripAction */
            CSL_EPWM_TZ_EVENT_ONE_SHOT,         /* tripEvtType */
            0U,                                 /* tripPin */
            FALSE                               /* enableTripIntr */
        },
        /* CSL_EpwmEtCfg_t */
        {
            CSL_EPWM_ET_INTR_EVT_CNT_EQ_ZRO,    /* intrEvtSource */
            CSL_EPWM_ET_INTR_PERIOD_FIRST_EVT   /* intrPrd */
        }
    }
};

static volatile uint32_t gNumIsr = 0U;
volatile uint32_t *gNumIsr2 = (volatile uint32_t*)0x40301000;

#if defined (SOC_TDA2XX) || defined (SOC_TDA2PX) || defined (SOC_DRA75x) || defined (SOC_TDA2EX) || defined (SOC_DRA72x)
static uint32_t uartBaseAddr = SOC_UART1_BASE;
#endif
#if defined (SOC_TDA3XX) || defined (SOC_DRA78x)
static uint32_t uartBaseAddr = SOC_UART3_BASE;
#endif
static uint32_t uartBaseAddr = SOC_UART3_BASE;

/* ========================================================================== */
/*                 Internal Function Declarations                             */
/* ========================================================================== */

static void AppPwmIntrISR(void *handle);

static void CSL_epwmAppPwmCfg(CSL_EpwmAppPwmObj_t *pObj);
static void EpwmAppTimebaseModuleCfg(uint32_t baseAddr,
                                     uint32_t pwmFuncClk,
                                     CSL_EpwmTimebaseCfg_t *pTbCfg);
static void EpwmAppCounterComparatorCfg(uint32_t baseAddr,
                                        CSL_EpwmCounterCmpCfg_t *pCcCfg);

static void padConfig_prcmEnable(void);

/* ========================================================================== */
/*                          Function Definitions                              */
/* ========================================================================== */

int32_t main(void)
{
    CSL_EpwmAppPwmObj_t *pObj = &gAppPwmObj;

    /* Do pad config amd PRCM enable for UART and PWM */
    padConfig_prcmEnable();

    /* Initialize the UART Instance */
    UARTConfigInit(uartBaseAddr, BAUD_RATE_115200,
                   UART_WORD_LENGTH_8, UART_STOP_BIT_1,
                   UART_NO_PARITY, UART_16x_MODE);
    UARTConfigPuts(uartBaseAddr,
        "\nStarting EPWM duty cycle test application...\n", -1);
    UARTConfigPuts(
        uartBaseAddr, "Probe the PWM signal to verify...\n"
        "App will wait for 10 seconds (using  PWM period ISR)...\n", -1);
    UARTConfigPuts(uartBaseAddr,
        "Probe "
#if defined (SOC_TDA2XX) || defined (SOC_TDA2PX) || defined (SOC_DRA75x) || defined (SOC_TDA2EX) || defined (SOC_DRA72x)
        "VIN2A_VSYNC0 pin (RU19 pin 12) "
#endif
#if defined (SOC_TDA3XX) || defined (SOC_DRA78x)
        "GPMC_BEN0 pin (R9017/M1 of VISU connector) "
#endif
        "for 1KHz @ 25% duty cycle waveform...\n", -1);

    /* Enable clocks for EPWM module inside the PWM sub system. */
    CSL_epwmClockEnable(pObj->instAddr);

    /* EPWM channel configuration */
    CSL_epwmAppPwmCfg(pObj);

    *gNumIsr2 = 0;

    /* Wait for ISR count */
    //while (gNumIsr < APP_RUN_TIME_ISRCOUNT);
    while(1);

    //UARTConfigPuts(uartBaseAddr, "\nApplication is completed!!\n", -1);
    //return 0;
}

static void AppPwmIntrISR(void *handle)
{
    uint16_t status = CSL_epwmEtIntrStatus(APP_EHRPWM_INST_BASE_ADDR);

    CSL_epwmEtIntrClear(APP_EHRPWM_INST_BASE_ADDR);
    //gNumIsr++;
    *gNumIsr2 = (*gNumIsr2) + 1;
    return;
}

/**
 * \brief   This API configures the ePWM module
 *
 * \param   pObj             pointer to the ePwm object data structure.
 */
static void CSL_epwmAppPwmCfg(CSL_EpwmAppPwmObj_t *pObj)
{
    uint32_t baseAddr = pObj->instAddr;
    uint32_t pwmCh    = pObj->pwmCh;
    uint32_t pwmFuncClk = pObj->funcClk;
    CSL_EpwmAppPwmCfg_t *pPwmCfg = &pObj->pwmCfg;

    /* Configure the Time base Sub-Module */
    EpwmAppTimebaseModuleCfg(baseAddr, pwmFuncClk, &pPwmCfg->tbCfg);

    /* Counter-Comparator Sub-Module Configuration */
    EpwmAppCounterComparatorCfg(baseAddr, &pPwmCfg->ccCfg);

    /* Configure Action Qualifier */
    CSL_epwmAqActionOnOutputCfg(baseAddr, pwmCh, &pPwmCfg->aqCfg);

    /* Dead band sub-module configuration */
    if (TRUE == pObj->enableDeadband)
    {
       /* Enable and configure dead band sub module */
       CSL_epwmDeadbandCfg(baseAddr, &pPwmCfg->dbCfg);
    }
    else
    {
        /* Bypass dead band sub module */
        CSL_epwmDeadbandBypass(baseAddr);
    }

    /* Chopper sub-module configuration */
    if (TRUE == pObj->enableChopper)
    {
        /* Configure chopper sub - module */
        CSL_epwmChopperCfg(baseAddr, &pPwmCfg->chpCfg);

        /* Enable Chopper */
        CSL_epwmChopperEnable(baseAddr, TRUE);
    }
    else
    {
        /* Disable Chopper */
        CSL_epwmChopperEnable(baseAddr, FALSE);
    }

    /* Trip Zone Sub-Module Configuration */
    if (TRUE == pObj->enableTripZone)
    {
        /* Configure the Trip action */
        CSL_epwmTzTriggerTripAction(
            baseAddr, CSL_EPWM_TZ_TRIP_ACTION_HIGH, pwmCh);

        /* Enable the Trip event */
        CSL_epwmTzTripEventEnable(
            baseAddr, pPwmCfg->tzCfg.tripEvtType, pPwmCfg->tzCfg.tripPin);
    }
    else
    {
        /* Disable trip zone event handling and ignore all trip zone events */
        CSL_epwmTzTripEventDisable(
            baseAddr, CSL_EPWM_TZ_EVENT_ONE_SHOT, pPwmCfg->tzCfg.tripPin);
        CSL_epwmTzTripEventDisable(
            baseAddr, CSL_EPWM_TZ_EVENT_CYCLE_BY_CYCLE, pPwmCfg->tzCfg.tripPin);
    }

    /* Event trigger sub - module configuration */
    if (TRUE == pObj->enableEventTrigger)
    {
        /* Configure the Event trigger processing */
        CSL_epwmEtIntrCfg(
            baseAddr, pPwmCfg->etCfg.intrEvtSource, pPwmCfg->etCfg.intrPrd);
        CSL_epwmEtIntrEnable(baseAddr);
    }
    else
    {
        /* Disable Event trigger interrupts */
        CSL_epwmEtIntrDisable(baseAddr);
    }

    /**
     * High resolution feature is supported only on PWM A channel. If channel
     * is A then proceed with High Resolution processing.
     */
    if (CSL_EPWM_OUTPUT_CH_A == pwmCh)
    {
        if (TRUE == pObj->enableHighResolution)
        {
            /* configure high resolution feature */
            CSL_epwmHighResolutionCfg(
                baseAddr,
                pPwmCfg->hrCfg.delayBusSelect,
                pPwmCfg->hrCfg.delayMode);

            if (CSL_EPWM_HR_DELAY_BUS_SEL_CMPAHR ==
               pPwmCfg->hrCfg.delayBusSelect)
            {
                /* Load comparator A High-resolution counter value */
                CSL_epwmHrLoadCmpAHrValue(
                    baseAddr,
                    pPwmCfg->hrCfg.cmpAHighResVal,
                    CSL_EPWM_HR_REG_ACT_LOAD_CNT_ZRO_PULSE);
            }
            else  /* CSL_EPWM_HR_DELAY_BUS_SEL_TBPHSHR */
            {
                /* Load Timebase phase high resolution value */
                CSL_epwmHrLoadTbPhaseHrValue(
                    baseAddr, pPwmCfg->hrCfg.tbPhaseHighResVal);
            }
        }
        else
        {
            /* Disable High Resolution Feature */
            CSL_epwmHighResolutionDisable(baseAddr);
        }
    }

    return;
}

/**
 * \brief   This API configures the Timebase Sub-module.
 *
 * \param   baseAddr        Base address of PWMSS instance used
 * \param   pwmFuncClk      PWM functional clock value in Hz
 * \param   pTbCfg          Pointer to the Time base sub-module configuration
 *                          data structure
 */
static void EpwmAppTimebaseModuleCfg(uint32_t baseAddr,
                                     uint32_t pwmFuncClk,
                                     CSL_EpwmTimebaseCfg_t *pTbCfg)
{
    /* Configure Time base clock */
    CSL_epwmTbTimebaseClkCfg(baseAddr, pTbCfg->tbClk, pwmFuncClk);

    /* Configure PWM time base counter frequency and direction */
    CSL_epwmTbPwmFreqCfg(
        baseAddr,
        pTbCfg->tbClk,
        pTbCfg->pwmtbCounterFreqPrd,
        pTbCfg->tbCntrDirection,
        CSL_EPWM_SHADOW_REG_CTRL_ENABLE);

    if (TRUE == pTbCfg->enableSynchronization)
    {
        /* Enable Synchronization */
        CSL_epwmTbSyncEnable(
            baseAddr, pTbCfg->phsCountAfterSync, pTbCfg->cntDirAfterSync);
    }
    else
    {
        /* Disable Synchronization */
        CSL_epwmTbSyncDisable(baseAddr);
    }

    /* Configure Sync out signal */
    CSL_epwmTbSetSyncOutMode(baseAddr, pTbCfg->syncOutSrc);

    /* Configure the emulation behaviour */
    CSL_epwmTbSetEmulationMode(baseAddr, EPWM_TB_EMU_MODE_FREE_RUN);

    return;
}

/**
 * \brief   This API configures the Counter-Comparator Sub-module.
 *
 * \param   baseAddr    Base address of PWMSS instance used
 * \param   pCcCfg      Pointer to the Counter-Comparator Sub-module
 *                      configuration data structure
 */
static void EpwmAppCounterComparatorCfg(uint32_t baseAddr,
                                        CSL_EpwmCounterCmpCfg_t *pCcCfg)
{
    /* Counter Comparator A configuration */
    CSL_epwmCounterComparatorCfg(
        baseAddr,
        CSL_EPWM_CC_CMP_A,
        pCcCfg->cmpAValue,
        CSL_EPWM_SHADOW_REG_CTRL_ENABLE,
        CSL_EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO,
        TRUE);

    /* Counter Comparator B configuration */
    CSL_epwmCounterComparatorCfg(
        baseAddr,
        CSL_EPWM_CC_CMP_B,
        pCcCfg->cmpBValue,
        CSL_EPWM_SHADOW_REG_CTRL_ENABLE,
        CSL_EPWM_CC_CMP_LOAD_MODE_CNT_EQ_ZERO,
        TRUE);

    return;
}

static void padConfig_prcmEnable(void)
{
#if defined (SOC_TDA2XX) || defined (SOC_TDA2PX) || defined (SOC_DRA75x) || defined (SOC_TDA2EX) || defined (SOC_DRA72x)
    /* UART Pad configurations */
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_UART1_RXD, 0x00040000);
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_UART1_TXD, 0x00000000);

    /* PWM Pad configurations - VIN2A_VSYNC0 -> EHRPWM1A */
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_VIN2A_VSYNC0, 0x0000000A);
#endif
#if defined (SOC_TDA3XX) || defined (SOC_DRA78x)
    /* UART Pad configurations */
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_IO_SPI1_SCLK, 0x00040001);
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_IO_SPI1_CS0, 0x00000001);

    /* PWM Pad configurations - GPMC_BEN0 -> EHRPWM1A */
    HW_WR_REG32(
        SOC_CORE_PAD_IO_REGISTERS_BASE+CTRL_CORE_PAD_IO_GPMC_BEN0, 0x00000004);
#endif

    /* Enable PRCM for PWMSS1 */
    HW_WR_REG32(SOC_L4PER_CM_CORE_BASE + CM_L4PER2_PWMSS1_CLKCTRL, 0x2);
    while ((HW_RD_REG32(SOC_L4PER_CM_CORE_BASE +
                        CM_L4PER2_PWMSS1_CLKCTRL) & (0x00030000)) != 0x0) ;
    /* Time base clock for PWMSS1 module */
    HW_WR_FIELD32(
        SOC_CTRL_MODULE_CORE_CORE_REGISTERS_BASE + CTRL_CORE_CONTROL_IO_2,
        CTRL_CORE_CONTROL_IO_2_PWMSS1_TBCLKEN,
        1);

    /* XBar configuration */
    CSL_xbarIrqConfigure(
        APP_EHRPWM_XBAR_CPU, APP_EHRPWM_XBAR_INST, APP_EHRPWM_XBAR_INTR_SOURCE);

    /* Enable periodic interrupts for PWM period */
    Intc_Init();
    Intc_IntEnable(APP_EHRPWM_INT);

    /* Register ISR */
    Intc_IntRegister(APP_EHRPWM_INT, (IntrFuncPtr) AppPwmIntrISR, 0);
    Intc_IntPrioritySet(APP_EHRPWM_INT, 1, 0);
    Intc_SystemEnable(APP_EHRPWM_INT);

    return;
}
-stack  0x1000                             /* SOFTWARE STACK SIZE           */
-heap   0x2000                             /* HEAP AREA SIZE                */

/* SPECIFY THE SYSTEM MEMORY MAP */

MEMORY
{
        RST_START:      org = 0x00800000  len = 0x0300
        IRAM_MEM:       org = 0x00800300  len = 0x7c00
        MMU_TLB:		ORIGIN = 0x4031C000  LENGTH = 0x000004000
		/*SBL will use 1 KB of space from address 0x80000000 for EVE */
        DDR3_A8:		org = 0x80000400 len = (0x0B000000 - 0x400)    /* 176 MB */
        DDR3_BOOT:      org = 0x8B000000 len = 0x00010000    /* 32 MB */
		DDR3_DSP:		org = 0x8B010000 len = 0x01FF0000    /* 32 MB */
		DDR3_M3VPSS:	org = 0x8D000000 len = 0x01000000    /* 16 MB */
		DDR3_M3VIDEO:	org = 0x8E000000 len = 0x01000000    /* 16 MB */
		DDR3_SR0:		org = 0x8F000000 len = 0x01000000    /* 16 MB */
}

/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

SECTIONS
{
	boot :
	{
	 rts*.lib<boot.obj>(.text)
	}load > DDR3_BOOT

	.cachetest_ddrbuf > IRAM_MEM
    GROUP: load > IRAM_MEM
    {
        .bss:       /* UNINITIALIZED OR ZERO INITIALIZED */
        .neardata:
        .rodata:
    }
    BOARD_IO_DELAY_DATA : load > IRAM_MEM
    BOARD_IO_DELAY_CODE : load > IRAM_MEM
    .csl_vect : load > RST_START
    .vects : load > IRAM_MEM
    .l2_int  : load > IRAM_MEM
    .pmIdleFunc : load > IRAM_MEM
    .init    : load > IRAM_MEM
    .cio     : load > IRAM_MEM

    .text 	 : load > IRAM_MEM              /* CODE                         */
    .data    : load > IRAM_MEM              /* INITIALIZED GLOBAL AND STATIC VARIABLES. */
                                            /* GLOBAL & STATIC VARIABLES.   */
                    RUN_START(bss_start)
                    RUN_END(bss_end)
    .const   : load > IRAM_MEM              /* GLOBAL CONSTANTS             */
    .cinit   : load > IRAM_MEM
    .stack   : load > IRAM_MEM            /* SOFTWARE SYSTEM STACK        */
	.far	 : load > IRAM_MEM
	.plt     : load > IRAM_MEM
	.fardata : load > IRAM_MEM
	.switch	 : load > IRAM_MEM
	.my_sect_ddr : load > IRAM_MEM
	.sysmem : load > IRAM_MEM
}

Viewing all 17527 articles
Browse latest View live