This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCND & Boot Loader erasable page size = 2K?

Guru 55913 points
Other Parts Discussed in Thread: EK-TM4C1294XL, LM3S8971, TM4C1294NCPDT

The (bl_config.h) holds parameters for the data transport method in transferring the users application object code into the targets flash memory and booting that application from RAM after an MPU reset.

The Boot Loader text states all Tiva processors have a 1024k page length. However the source code listing states "Erasable Page" not writable page and the TM4C1294 erases 2 sectors at a time or a 2Kbyte page.

#Define Flash_Page_Size  0x00000400 = 1024 bytes would then be incorrect when 2Kbyte page 0x000007D0.

Does this source listing below incorrectly use the word (ERASABLE) page or does the function that uses this value need to know the page boundary when erasing before writing new bytes to flash?

// The size of a single, erasable page in the flash.  This must be a power of 2. The default value of 1024 bytes represents the page size for the internal flash on all Tiva MCUs and this value should only be overridden if configuring a boot loader to access external flash devices with a page size different from this.

Datasheet:

The interleaved memory prefetchs 256 bits at a time. The prefetch buffers allow the maximum performance of a 120 MHz CPU speed to be maintained with linear code or loops that fit within the prefetch buffer. It is recommended that code be compiled with switches set to eliminate "literals" as much as possible as a literal causes a flash access for that word and a stall for the wait states. Most compilers support transforming literals into "in-line" code, which executes faster in a system where the memory subsystem is slower than the CPU.

Because the memory is two-way interleaved and each bank individually is an 8-KB sector, when the user erases a sector, using the ERASE bits in the Flash Memory Control (FMC) register, it is a 16 KB erase. Erasing a block causes the entire contents of the block to be reset to all 1s.

  • Hello Brett

    Which example code are you referring to for bl_config.h? The readme and files for TM4C129 boot code has updates for TM4C129 as per 16KB page size

    C:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\dk-tm4c129x\boot_emac_flash

    Regards

    Amit

  •  16KB page size   Aren't page size always described as bytes not bits?

    EK-TM4C1294XL (bl_config.h) has erasable page size set at 1024 bytes, 0x00000400. Again the TM4C1294NCND data sheet states not possible to erase but a 2Kbyte page at any time. Not knowing the BL code extremely well beyond its application function makes me unsure what effect this page size actually has. The BL does FTP transfer of the application to flash memory, erasing only necessary pages, believe this may be why size does matter. Attached is the bl_config.h found in the \boot_loader root.

    2541.bl_config.h

    The EK-TM4C1294XL Boot Loader was packaged under:

    C:\ti\TivaWare_C_Series-2.1.0.12573\boot_loader.

    BTW: Has TI shipped any higher silicon above Rev1 to anyone? Asking because the errata found in revision 1 silicon  PWM can not trigger ADC (SSS) start sample sequence and wouldn't you know it that effects motor control. The one Mouser shipped me is Rev1 silicon and can not be used to migrate M3 to TM4C. :(

     

  • Hello Brett,

    I checked and re-checked the TIVAWare installation and the path mentioned has only bl_config.h.tmpl which is the template file. Cortex-M4 is a 32 bit processor so bit's really do not make sense for Flash Erase. It complicates the device more than expected.

    Not yet. The release of the Production Version with this issue amongst some other will happen towards end of 2Q'14

    Regards

    Amit

  • That was my bad, renamed (*.tmpl) figured was named (temp) by mistake, might explain why CCS5 suggests symbols not found during linking.  Attempting to migrate Boot_Eth project which links all BL c files from RDK v10636 where it had Ethernet transport assigned in bl_config.h . So far the only difference was bl_enet.c is now bl_emac.c , expected some issues in this area.

    The RDK Ethernet GUI allows flashing of the target from a *.bin file using FTP transport in BL. Hope that remains constant until finished moving a few RDK functions into the cloud, time sharing the Ethernet between web and original GUI or use GUI composer with ICDI might prove more prudent. Added CPU utilization into the cloud last night and found it not to difficult, do for see the collective growing beyond 542 near future.

    Not yet. _ This is odd news after seeing revision 5 silicon somewhere in documents at TI. Do you know if there is a work around for the errata PWM0 not able to trigger ADC0_1-3 SSS

    Anyone interested this is where to find the revision level adding minor and major together.

  • Boot Loader compiled without error after renaming the (bl_config.h.tmpl) which also had the page size set 1024 bytes.

    Seemingly the single erasable page size 2 x 8KB sectors or 16Kbyte Block % 8bits = 2kbyte page size (0x000007D0).

    Thanks Amit :)

  • Hello Brett

    Revision 5 would be on TM4C123. TM4C129 does not have a Revision-5

    Regards

    Amir

  • @ Amit,

    When the manual speaks to, "2K byte page size" - might that really suggest 2048 bytes? (0x0000.0800)  If not - those remaining 48 bytes sit alone/unused...  Of course this stems from the binary/decimal frame of reference - and most always MCU Apps tend toward the binary...  (that repeat use of 0x07D0 (2K decimal) rings unusual/doubtful)

  • The TM4C1294 errata sheet suggest rev. 3 silicon is, has been in production. Unsure rev.1 will synchronize PWM counters when dividing SYSCLK @120Mhz. Using PWMDIV=%2 on PWM0 peripheral block, the 60Mhz clock renders 3000 ticks/sec. That alone introduce other issues when LM3S8971 50Mhz SYSCLK was used as the PWM clock with out PWMDIV. Mouser claimed were a brand new TI shipment of EK-TM4C1294Xl board, was fearful to find revision 1 chip. Have asked Mouser to ship a higher revision EK board as they could only provide the manufacture date which was later found to be March 2013, far existing from a new batch.

    Do you know if errata (yellow box) was random among certain production runs and may not effect all chips in revision 1 class? Would think testing for errata among production runs does not test every chip made, TI may only test 500 out of every 5K produced.

    Literature Number: SPMZ850B

    October 2013–Revised March 2014

  • Hello Brett,

    Revision-3 is not in production. And the errata marked in yellow is not random. It is very easy to reproduce.

    Regards

    Amit

  • Hello cb1_mobile,

    The 2K is 2048 bytes as you mentioned. There is no 0x7D0 for 2K (decimal) representation. I am not sure why the poster mentions it as 0x7D0.

    Regards

    Amit

  • Then revision 2-3 are experimental?  One would not easily draw that deduction from the sheet columns 2-3.

     

    BTW: Poster stated 7D0; The datasheet shows an even 16KB block but had already deduce page size 800h or 2048 would be better choice. CB1 beat poster to the correction. That doesn't preclude the fact (bl_config.h.tmpl) suggests a 1024KB page size and the Tiva Boot Loader PDF shows (bl_config.h). Not trying to be anal retentive in this statement however "That which is gibberish translates in the very same way it is read" especially this shop. :) 

    Per Boot Loader PDF:

    SW-TM4C-BOOTLDR-UG-2.1.0.12573.pdf  Quote: The Ethernet controller will be configured to use the MAC address stored in the USER0/UART1 data registers or the MAC address that is provided in the boot loader configuration file (bl_config.h).

  • @ Amit,

    Lost in this thread may be the fact that poster has long been in the design/development of an exotic BLDC motor - and he/I have engaged regularly in tweaking (hopefully improving) the past BLDC-RDK kit employing LM3S8971.  Several years past my small design group (separate from poster's) transitioned from nrnd to LX4F - gained much in that process.  And we continue to use the long "tried/true/tested" StellarisWare over the newer/changing/ rebrand issue.

    Now - clearly you are terrific - wonderful vendor representative.

    That said - poster had effectively, "yellow highlighted" critical PWM errata - and employed the word, "random" - likely to convey his displeasure with the errata's imprecision.  Does not the errata employ bit of, (pardon) "weasel wording" - i.e. ("under certain conditions," and "may not Synchronize," and "may not generate!")

    What are those (undescribed), "certain conditions," and when/why may it, "not Synchronize," and when//why may it, "not generate" the much sought & specification matching, (i.e. normally expected) PWM behavior?   

    Now you add that each/every such errata condition may be regularly caused (i.e. clearly repeatable) -  would not the sharing of such critical MCU data be of great value to your users?

    Failure to offer known data beyond, "certain conditions," and "may not" is neither comforting nor of hardly any practical use to your most dedicated, active, & (unfortunately) becalmed users.  

    Amit you clearly are in no way the cause of this "erratic" errata - yet you're the one who may be able to share work-arounds and likely "guard-band" we hapless/struggling users!   Would you be so good as to look into a more "client friendly (i.e. bit more detailed) errata listing" - which less masks any/all actions we client users may take to minimize errata's harmful impact?  Thanks.

  • Hello Brett

    Version 3 is expected to be Production once we complete the full testing and characterization.

    Regards

    Amit

  • @ Amit,

    Would you be so good as to give a second look @ my 10:45 posting, earlier today.  (I've slightly re-worded to better frame the critical PWM issues befalling o.p., my group, & most likely multiple others... )  The language in the PWM Section of this MCU's errata is sufficiently vague as to cause the o.p. to describe the errata's impact as, "random." 

    Does not this lack of errata specificity potentially raise - or at minimum contribute to - the creation of, "false hope?"  (i.e. user's may attempt to weave their way "around" errata's, "under certain conditions" and, "may nots" - expending time, effort, funds in that process.)    Is this ideal - is this proper?  (and what if the factory "corrections" are not, "ready by the suggested 2Q-14 promise date?)

    Would it not be much better if the more complete, "inside info" - known by you to invoke each PWM errata condition - were instead shared with motivated users - rather than held strictly w/in headquarters?  The efforts of multitudes here may even assist and/or speed your firm's resolution of that errata - especially if the likely, "errata trigger events/conditions" were, "made clearly known."  Seems more, "win-win" than present method's, "hint but obscure" - don't you agree?

    Thank you...

  • Hello cb1_mobile,

    I agree, that the information may be pretty vague to a user as it does not mention the conditions under which the interrupt and trigger may not be generated, But considering that it is a basic requirement from the PWM that the interrupt ought to be working it was thought to be sufficient.

    I will check with the team if there could be a better description to this.

    Regards

    Amit

  • Once again - your responsiveness, caring & expertise shine through.  Thank you, Amit.

    PWM generation and its normal/customary off-shoots (i.e. interrupts, triggers & fault management) are crucial to so many designs - and so many here - clearly this vague errata listing (hi-lighted by o.p.) deserves better treatment.

    And - as earlier stated - perhaps the multitudes here - some motivated, skilled, under time-crunch (i.e. desperate) may just discover  successful, "work-arounds" - enabling at minimum - some PWM recovery far earlier than the release of "next/hopefully corrected" silicon!   (perhaps not as far-fetched as some think - such, "user-fix" has occurred multiple times in the past!)   Enlightened semi firms "tap" this "free resource" - if they can (somewhat) overcome, "NIH" bias...

    Thanks again - quite the resource you are proving...  (do note that my efforts/voice target what I trust to be, "constructive issue identification" & alternative (sometimes imaginative) methods of resolution...)

  • But considering that it is a basic requirement from the PWM that the interrupt ought to be working it was thought to be sufficient.

    Believe it was also BP101 who inquired about silicon revisions for this very reason prior to purchase of EK-TM4C1294lx desired for the launch pad X11 and Internet of Things Cloud management alerting of ADC events gone all wrong.

    That was a long shot taken, errata; PWM0 dysfunctional triggering an ADC interrupt signaling start of sequence.

    Timing the zero cross over points in a trapezoidal wave form require ADC monitored BEMF signals to be in sync with PWM commutation or FOC would become dysfunctional and provide useless rotating flux in a BLDC rotor. The outcome, a vibrating rotor great for aches pains or if one should sit upon such errata the imagination is limitless.

  • Hello BP101,

    Sometimes the issues come at the place where we least expected. That is what happened with PWM and that is why the errata had it early on. Worst case scenario would not be putting it in the errata and customers having a hard time with the feature to work.

    Apologies if it has caused so much pain. Production version would fix this for sure and you would be required to do a swap of the part.

    Regards

    Amit

  • Hi Amit, Sounds as if you imply the TM4C1294NCPDT is not a production chip installed on EK-TM4C1294XL board.

    TM4C— Production version of the silicon die that is fully qualified.

    Have not yet introduced PWM drive code to TM4C1294NCPDT. Merely researching the what and why prior being slammed down on tracks, freight train so ruthlessly taking final breath.  

    Hopefully PWM peripheral functions in revision 1 silicon will be less erratic than experimental silicon versions (XM4C) fully tested prior to production of revision 1 silicon. The errata sheet covers silicon revisions 1-3 any of which could have been experimental silicon discussed in the errata document for any chip in the TM4C129x family.

    One can easily draw onerous conclusions due to the lack there of pertinent data being left from intellectual disclosure documents.

  • Should PWM0 errata become an issue there is a work around or idea that just may provide a 100% reliable alternative to using PWM0-Gen0 comparator zero count interrupt and ADC trigger pulse. The potential diverted any PWM0 erratic interrupt being left for road kill in a one track highway to hell should documented errata actually persist.

    Possibly via one Timer put to use monitoring PWM0-Gen0 High/Low side output pins, input as separate CCP timer A/B events the train wreck can be diverted to a friendlier track, less the road kill is persistent beyond those bounds.

    Perhaps the TI Gurus can add a workaround to the PWM errata document after all?

  • Crazy Generous!

  • 1/3/2015 -- Yes & No;

    TivaWare_C_Series-2.1.0.12573 (flash.c) (bl_flash.c) force entire 16KB to be erased prior to flashing 512 byte packet block Software Boot Loader.

    The erase page block size of Stellarisware was previously 1024 bytes (0x0000.0400) for the same 512 byte packet block to be flashed.

  • Hello BP101,

    The Sector Size for TM4C129 has changed to 16KB hence the erase size.

    Regards
    Amit
  • That makes no logical sense at all, the entire sector has to be erased just to flash a single page. LM flash programmer (1601) is not constrained to a 16KB sector erase, adding to the confusion. The application can be LM flashed to 0x0000.3000 and the Boot Loader will Invoke the Application without error.

    However if TFTP is used to load & flash a new application image then the Boot Loader and Application are both mangled by the erase function of (flash.c) & (bl_flash.c).
  • Hello BP101

    Let me get the context first.

    (a) You are referring to TM4C129, where the Sector Size is 16KB due to the two banks (each 8KB) kept side-by-side?
    (b) When you program 1 Byte also and want to erase the Byte then the entire Sector has to be erased. The same logic applies for 512Bytes. For TM4C123 the size was down to 1024 Bytes for a Sector/Page

    While it may make no logical sense to have 16KB erase for 512Byte Program, it has cost impact on the final device.

    Regards
    Amit
  • Brett,

    Amit's quite right - adding the "fine granularity" you (seem) to seek requires more (internal) MCU address lines - and decodes - surely adds complexity & cost.  And - if you follow (other) ARM MCUs (as we do) you'll note this "wider" page size is a notable trend - not unique here.

    Change is (not always) wonderful - you may consider (bit warmer) embrace...

  • (b) When you program 1 Byte also and want to erase the Byte then the entire Sector has to be erased.
    Appears the TM4C129 Boot Loader application may have been copied from TM4C123 without review of (bl_bootcfg.h) because Erase pages size was set to 0x0000.0400 adding to the mystery.

    Again the confusing part LM Flash is not having the same issue. Some how LM Flash can correctly offset the application inside the first 16KB sector of Boot Loader. Re- LM Flashing Boot Loader succeeds without mangling the application or Boot Loader. The real question is why can LM Flash erase less than a 16KB page if the TM4C129 is so called constrained to 16KB sector erase?

    Verified flash anomaly (flash.c & bl_flash.c) reading back the mangled object address space. A few bits in each byte are mangled in the hex object of Boot Loader. That happens no matter if application is offset 16KB, it is not flashed at the correct start address if the erase (page) size is set 1024 bytes or below 16KB.
  • Hello BP101

    Sometimes 2 wrongs make a right and I agree with you that is an error which we have in the fix-pipe for the next TivaWare release as I ran into the same issue.

    No it cannot do less than 16KB erase for TM4C129.

    Regards
    Amit
  • Hi Amit,

    Again Thank You for making it clear the 16KB Boot Loader boundary also infers the erase (page) size must be set as a 16KB sector size.

    The erase bits FMC topic first post above do not state the user must erase the entire sector to write a page, rather states when the user wants to erase the entire sector it is a 16KB erase. LM FLASH appears to allow erasing only the necessary pages inside a 16KB sector prior to a write.
  • BP101 said:
    LM FLASH appears to allow erasing only the necessary pages inside a 16KB sector prior to a write.

    Mon (much tormented) ami,

    Before your, Amit's & this reporter's head (all) explode - how do you note (ideally confirm) that (suspect) reduced page-erase, "appearance?" 

    Would it not be quick, relatively easy for you to first "seed" several unique data patterns (even 4-8 bytes should work) w/in multiple of your (hoped for) 2KB, adjacent, flash sectors?  (suggest that you seed all 8 of those 2KB flash sectors)  And then - cause vaunted (all knowing) LM Flash to generate it's "wondrous, narrow-band, erase capability?"

    I'd place tall stack of chips upon (all 16KB) of TM4C1294NCND "LOSING" your earlier - pre-seeded, test data.  And - such would be far stronger than a "hunch" or any "appearance."  Evidence has strict rules of admissibility & usage w/in the courtroom - proves most powerful.  "Appearance" - on the other hand - falls far down the scale...  (ever noticed how many - dressed to the nines - still are convicted?   So much for "appearance!")

    Suggested test is quick/easy - and should bring your understanding into agreement w/Amit's guidance - despite what you (thought/imagined) you (once) saw!

  • Hello BP101,

    That is something not possible unless. The Page Size of Erase is fixed and it cannot erase anything less than that, unless, there is a copy-erase-paste operation which is not done by boot loader.

    Regards
    Amit
  • how do you note (ideally confirm) that (suspect) reduced page-erase, "appearance?"

    Your honor object, the first post data sheet text as evidence; Erasing a (block), causes the entire contents of the block to be reset to all 1s. A page is 1/2 a block or 512 bytes and 2 pages = a single block 1024KB. Even stranger, TFTP block processing loop (Emac.c) writes blocks from 512 byte packets as two 512 byte pages 1024 bytes just as Stellarisware did.

    Amit above post states he can reproduce this issue. One is left to only imagine block writes below a 16KB sector can be preformed by Tivaware (flash.c) while actually it can only erase or write the entire 16KB flash sector, nothing less.
  • Hello BP101,

    I was referring to the incorrect definition of a Page Size in the boot loader files and not to the size of the page/sector.

    Regards
    Amit
  • That erase page size (bl_config.h) is constraining (flash.c) all application blocks must exist on a sector boundary. Again LM Flash has no such limitation. The application offset can exist inside the Boot Loaders 16KB memory space, (bl_config.h) can not constrain the LM Flash write process. That's why it is possible to locate the application at 0x0000.3000 and have Boot Loader copy it to SRAM to invoke it.

    So in effect Tivaware redefines a "single" page erase no longer possible when (flash.c) is the flashing source but LM Flash can still erase only necessary pages. I'm now ok with a constrained 16KB ERASE page sector but it seems an attempt was made to change Stellarisware in a way that really confused things for M3 processor users migrating to M4 and it did.
  • Court (of public opinion) here duly notes that you've "passed" upon the chance of confirming the claim you made (and continue to make) for LM Flash.  Test is quick/easy - and my money's on Amit's guidance - not some "appearance."   (nice suit - btw - but you're still, Guilty!) 

  • Ignoring the evidence put forth puts grand jury at risk of pandering the court of private appeals. The facts are Tivaware (flash.c & bl_flash.c) are bugged. LM Flash programmer takes precedence a (Baseline) over all other C++ written programs. Secondary programs manipulating flash have to conform to the baselines fundamental workings as they did in Stellarisware or problems will arise.

    At a minimum the Doxygen statements need to then reveal the inner constraints of the manipulating program or the audience will be stumped. Again the facts, Stellarisware Boot Loader was forever 0x0000.1000, Doxygen stated. LM-Flash worked flawlessly as did (flash.c) each following the same convention with no divergence in play. Setting Boot Loaders erase page size parameter below 16KB invokes this divergence. Tiva Boot Loader is not 16KB long and empty flash space remains in that 16KB page boundary which LM Flash is quite capable to use for the application. The forced 16KB constraint of (flash.c) is truly unjustified.

    Every scientist knows when the baseline becomes skewed or secondary the experiments (control) is then lost.
  • One more thing dawned on me after thinking a bit more this situation. This poster only seeks to alert TI professionals something is not as it would be expected.

    TM4C1294 Tivaware (flash.c - bl_flash.c) may have an issue to address across a constrained sector boundary during page erase or writes. LM-Flash Programmer does not have any such problem erasing only (necessary) pages or writing bytes across 16KB sector boundaries. With roughly 62 sectors 1024KB flash memory, Tivaware (flash.c) should be able to erase & write blocks across any constrained sector boundary. So in effect flash erase pages have become entire sectors in this issue.

    Do believe LM-Flash Programmer ruled out TM4C1294 flash schema being faulted in this bout, he can wait in corner for the next bell ring.

     

  • Hello BP101,

    It is not as it should be based on the device class. We would revisit the files to correct the flash size erases as it should be.

    Regards
    Amit
  • Reviewed that flash page addressing part of (flash.c) code, written by a level 10 C++ expert - is way above my pay grade.

    Thanks! Your #1 Amit.