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 - Chris

Pages: [1]
1
Ah! enabling the clock did the trick thanks again, you rock!

2
Hey Mark / Guys,
I am having an issue implementing ADC access in the Serial Bootloader....
I am using a slightly modified version of the uTaskerSerialBoot Application in KDS and I think something is going on that i might be simply overlooking.
I didn't see an easy way to access ADC channels so I attempted to initialize and read the hardware registers directly but I am running into resets when finishing the calibration routine or seemingly accessing any hardware addresses directly.


//----.h header-----
#define ADC0_CFG1            (*(volatile uint32_t *)0x4003B008)
#define ADC0_CFG2            (*(volatile uint32_t *)0x4003B00C)
#define ADC0_SC2                   (*(volatile uint32_t *)0x4003B020)
#define ADC0_SC3                   (*(volatile uint32_t *)0x4003B024)
#define ADC_SC3_CAL            ((uint32_t)0x80)

//----  I call this function first without problems

//----.c code-----

void analog_init(void)
{
   ADC0_CFG1 = (uint32_t)0x7B;
   ADC0_CFG2 = (uint32_t)0x48;
   ADC0_SC2 = (uint32_t)0;
   ADC0_SC3 = (uint32_t)0x87;
}

//----  Then I call the following

void wait_cal(void)
{
  int attemptscnt = 0;
   while (ADC0_SC3 & ADC_SC3_CAL) {
      attemptscnt += 1;
   }
}



The code fails and the board resets as soon as i try to read ADC0_SC3..

thinking i might be waiting too long and inadvertently triggering a watchdog reset I changed 

while (ADC0_SC3 & ADC_SC3_CAL) {
to
if (ADC0_SC3 & ADC_SC3_CAL) {

but the behavior continues...
It looks like the Kinetis_ADC stuff is all #ifdef out but I could be missing something that is causing a conflict
can you think of anything that might cause this or maybe have some things i could check for?
any help is greatly appreciated.

3
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 22, 2017, 07:13:53 PM »
Thanks again mark!
I can confirm working operation with the latest NXP_Kinetis_Bootloader_2.0.0 package(REV 2.0)

It does not like to identify the chip
Collecting device information......
Error: Update status failed(invalid vector<T> subscript).

but going straight to hitting the update button works as expected
Start update progress......
No device is connected!
Try to connect device......
Connected to device successfully!
Get device security state successfully(UNSECURE).
Updating image......
Update image successfully!
Reset device successfully!
Update process is completed.


4
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 22, 2017, 03:27:31 AM »
Hey Mark,
What parameters would I need to define to utilize the KBOOT HID Functionality?
I had read on the NXP community page that this was supported for teensy 3.1?

5
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 21, 2017, 03:51:47 AM »
great success!
It would have taken me ages to sort that out without your help thank you very much!

6
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 20, 2017, 10:20:45 PM »
NVM yet another KDS bug. for some reason it didnt save my change to the linker script.. now i am back to the point where It attempts to load a program via CDC s-record but doesnt actually commit to flash. steps to reproduce

#*** Testing uTasker Serial Loader ***

clone latest repo
copy kds settings files from \uTasker-GIT-Kinetis\Applications\uTaskerV1.4\KinetisDesignStudio\Project_Settings\ to \uTasker-GIT-Kinetis\

in KDS version 3.2.0
file -> import
   General -> Existing Projects into Workspace
   select projectroot\
   
Projcect Properties
   C/C++ General -> Indexer  -- check 'enable project specific', 'Use active build configuration' **do this every time reopened
   C/C++ Build -> Settings -> Target Processor -- change arm family to 'cortex-m4', set 'Float ABI' to 'Toolchain default' for all configs
   C/C++ Build -> Settings -> Cross ARM C++ Linker -> General -- change linker script to "${uTaskerLinkerScripts}/K_256_64.ld"
   
Applications -> uTaskerSerialBoot -> Config.h
   uncomment    //#define TEENSY_3_1 
   comment    #define FRDM_K64F
   
   uncomment   //#define USE_USB_CDC
   comment      #define USB_MSD_DEVICE_LOADER
   
Set Build configuration to 'uTaskerSerialLoader_FLASH'
Project -> Clean -> Clean All


***RESULTS***
bc
Checking Flash... EMPTY!
> ld
Please start S-REC download: ...

Terminated - restarting...bc
Checking Flash... EMPTY!
> bc
Checking Flash... EMPTY!
>



7
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 20, 2017, 10:10:08 PM »
you're on point!

ok that section of my config.h matched. so just to be safe I re-cloned and re-setup the project. using the same steps. crazy enough, it doesn't give the network errors anymore but it also doesn't enumerate the USB when loaded to a board. I assume you updated the repo? otherwise i am not sure why I would be getting different results.

8
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 20, 2017, 08:05:53 PM »
hey mark,
Thanks again my initial problem was as simple as making sure I started from a clean build. It seems KDS is very buggy or maybe I am just not used to clean builds being so important.

Even after getting the serial loader project to build I still haven't been able to get it to function correctly.
Using my initial pull I was able to get it to compile and load with USB CDC

> bc
Checking Flash... EMPTY!
> ld
Please start S-REC download: ...

Terminated - restarting...bc
Checking Flash... EMPTY!

It appears to accept the SREC but it never actually writes the data to flash. upon reset the application area is still empty
same result if i use my blinky.srec or the example 8080 srec you provided here http://www.utasker.com/kinetis/TEENSY_3.1.html so i dont think its a matter of the srec not being valid although interestingly enough if i change the config to MSD it will take the .bin and no longer run the loader but still not blink like it does when using all the example files you provide for loader and app

I wanted to start fresh so that i could document every step but it seems substantial changes have been made to the repo in the last few weeks which make it so now i cant even get to the non-functional version from above...

clone latest repo
copy kds settings files from \uTasker-GIT-Kinetis\Applications\uTaskerV1.4\KinetisDesignStudio\Project_Settings\ to \uTasker-GIT-Kinetis\

in KDS version 3.2.0
file -> import
   General -> Existing Projects into Workspace
   select projectroot\
   
Projcect Properties
   C/C++ General -> Indexer  -- check 'enable project specific', 'Use active build configuration' **do this every time reopened
   C/C++ Build -> Settings -> Target Processor -- change arm family to 'cortex-m4', set 'Float ABI' to 'Toolchain default' for all configs
   C/C++ Build -> Settings -> Cross ARM C++ Linker -> General -- change linker script to "${uTaskerLinkerScripts}/K_256_64.ld"
   
Applications -> uTaskerSerialBoot -> Config.h
   uncomment    //#define TEENSY_3_1 
   comment    #define FRDM_K64F
   
   
Set Build configuration to 'uTaskerSerialLoader_FLASH'
Project -> Clean -> Clean All


attempt to clean up assumed in progress updates... TO NO AVAIL
comment the following lines
   /Hardware/Kinetis/kinetis_ENET.h:426: undefined reference to `fnMagicFrame'
   /uTasker/Driver.c:284: undefined reference to `fnNetworkTx'
   /stack/Ethernet.c:199: undefined reference to `fnGetEthernetPars'
   /stack/arp.c:554: undefined reference to `network'
   /stack/arp.c:518: undefined reference to `network'
   /stack/dhcp.c:483: undefined reference to `fnGetDHCP_host_name'
   /stack/dhcp.c:516: undefined reference to `network'
   /stack/dhcp.c:670: undefined reference to `network'
   /stack/arp.c:551: undefined reference to `network'
comment the following entire functions      
   extern void fnTaskEthernet(TTASKTABLE *ptrTaskTable)
   static int is_subnet(unsigned char *new_ip)
   static void fnSendDHCP(unsigned char ucDHCP_message, int iNetwork)
   extern ARP_TAB *fnGetIP_ARP(unsigned char *Search_IP, UTASK_TASK OwnerTask, USOCKET Socket)
   static void fnStateEventDHCP(unsigned char ucEvent, int iNetwork)
   extern void fnDHCP(TTASKTABLE *ptrTaskTable)
   extern signed short fnSendIPv4(unsigned char *prIP_to, unsigned char ucProtType, unsigned char ucTypeOfService, unsigned char ucTTL, unsigned char *dat, unsigned short usLen, UTASK_TASK Owner, USOCKET cSocket)
   static void fnSendARP_request(ARP_TAB *ptrARPTab)
   extern signed short fnSendTCP(USOCKET TCP_socket, unsigned char *ptrBuf, unsigned short usDataLen, unsigned char ucTempFlags)


still nothing...  I really need to get to a point where I can compile a working loader maybe i am missing something in the config.h to properly turn off the immense amount of networking errors i am getting now?

9
µTasker general / Re: Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: December 05, 2017, 10:14:25 PM »
hey mark,
Thanks for getting back so quickly!

I have been attempting to build the uTaskerV1.4_FLASH configuration based on your input but now i am getting
"../Hardware/Kinetis/CMSIS_DSP/core_cm4.h:103:8: error: #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)""
Commenting the #error make it compile but not surprisingly it doesn't run beyond enumerating a USB serial device...

Taking a glance at the MK20DX256 manual it appears to not have an FPU. considering this, I attempted to change the FPU but without any luck.

"toolchain default" results in '../arm-none-eabi/bin/ld.exe: error: uTaskerV1.4.elf uses VFP register arguments, ../arm-none-eabi/lib/armv7e-m\libm.a(lib_a-wf_sqrt.o) does not'

can you give me a direction here? this should be basic stuff but i am struggling. thanks again


10
µTasker general / Getting Started with Teensy 3.1/3.2 mk20dx hw
« on: November 28, 2017, 11:39:30 PM »
Hello,
I am attempting to build in KDS IDE for mk20dx teensy 3.1/3.2 based hw.
so far i have not been able to get the project to compile properly.
the 'Bare Minimum' configuration builds but doesn't appear to work when loaded to the chip.
I am a little confused about how to configure the others. It seems the main project is missing teensy configuration in config.h

Just hoping to get some help getting started.
ultimately I am hoping to have a loader I can use which will allow for rawHID for application commands and debugging while normally appearing to the system as MSD
Is there any chance you could provide the projects you used to build the examples here http://www.utasker.com/kinetis/TEENSY_3.1.html ?
https://www.youtube.com/watch?v=K8ScSgpgQ6M was helpful to get me going but I am still missing something hopefully simple.

Pages: [1]